projects
/
demo_prior
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
slightly improved raytracer
[demo_prior]
/
src
/
part_whitted.c
diff --git
a/src/part_whitted.c
b/src/part_whitted.c
index
5b98ad6
..
d71585c
100644
(file)
--- a/
src/part_whitted.c
+++ b/
src/part_whitted.c
@@
-29,6
+29,7
@@
static int bnstate[8];
static int mouse_x, mouse_y;
static unsigned int sdr;
static int mouse_x, mouse_y;
static unsigned int sdr;
+static int uloc_aspect;
void reg_whitted(void)
void reg_whitted(void)
@@
-42,6
+43,7
@@
static int init(void)
if(!(sdr = create_program_load("sdr/whitted.v.glsl", "sdr/whitted.p.glsl"))) {
return -1;
}
if(!(sdr = create_program_load("sdr/whitted.v.glsl", "sdr/whitted.p.glsl"))) {
return -1;
}
+ uloc_aspect = get_uniform_loc(sdr, "aspect");
return 0;
}
return 0;
}
@@
-71,6
+73,7
@@
static void draw(long tm)
glTranslatef(0, 0, cam_dist);
glUseProgram(sdr);
glTranslatef(0, 0, cam_dist);
glUseProgram(sdr);
+ glUniform1f(uloc_aspect, win_aspect);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);