options/config
[demo_prior] / src / part_whitted.c
index 5b98ad6..be0152c 100644 (file)
@@ -23,12 +23,13 @@ static struct demo_part part = {
        mbutton, mmotion
 };
 
-static float cam_theta, cam_phi, cam_dist = 8;
+static float cam_theta, cam_phi = 15, cam_dist = 6;
 
 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);