void draw_scene(GLdouble degrees, GLint bits) { glEnable(GL_CULL_FACE); draw_room(); if (bits & TORUS_BIT) draw_torus(degrees); if (bits & SPHERE_BIT) draw_sphere(degrees); }
static void draw(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); glRotatef(view_rotx, 1, 0, 0); glRotatef(view_roty, 0, 1, 0); glRotatef(view_rotz, 0, 0, 1); glScalef(0.5, 0.5, 0.5); draw_torus(1.0, 3.0, 30, 60); glPopMatrix(); }
void draw(void) { GLenum err; GLdouble secs, degrees; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); /* one revolution every 10 seconds... */ secs = get_secs(); secs = secs - 10.*trunc(secs / 10.); degrees = (secs/10.) * (360.); #if 0 draw_room(); #endif draw_torus(degrees); err = glGetError(); if (err != GL_NO_ERROR) printf("Error: %s\n", gluErrorString(err)); glutSwapBuffers(); }