Hi, I am trying to rotate a simple square, but I am not seeing nay differences when I call glrotatef. My code:
glClear (GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
glOrtho (-1,1,-1,1,1,20);
float yRotationAngle = 0.3f;
glTranslatef(0.0f, 0.0f, -5.0f);
glRotatef (yRotationAngle, 0, 1, 0);
glBegin (GL_QUADS);
glColor3f (1,0,0); glVertex3f (.75,.75,0);
glColor3f (0,1,0); glVertex3f (.75,-.75,0);
glColor3f (0,0,1); glVertex3f (-.75,-.75,0);
glColor3f (1,1,1); glVertex3f (-.75,.75,0);
glEnd ();
Outside it, I have this call to glViewport inside X11 setup code:
do {
XNextEvent (dpy, &xev);
if (xev.type == Expose) {
XGetWindowAttributes (dpy,win,&gwa);
glViewport (0,0,gwa.width,gwa.height);
draw ();
glXSwapBuffers (dpy,win);
}