slightly improved raytracer
[demo_prior] / src / part_whitted.c
index 5b98ad6..d71585c 100644 (file)
@@ -29,6 +29,7 @@ static int bnstate[8];
 static int mouse_x, mouse_y;
 
 static unsigned int sdr;
+static int uloc_aspect;
 
 
 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;
        }
+       uloc_aspect = get_uniform_loc(sdr, "aspect");
        return 0;
 }
 
@@ -71,6 +73,7 @@ static void draw(long tm)
        glTranslatef(0, 0, cam_dist);
 
        glUseProgram(sdr);
+       glUniform1f(uloc_aspect, win_aspect);
 
        glBegin(GL_QUADS);
        glTexCoord2f(0, 0);