Original Post
Well, its strange, sometimes the sphere is rotated and sometimes it is not. It even depends where the mouse is and where the console box is. Compiled with mingw and Dev-C++
Code is here :
void renderScene()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0.0, 1.0, 0.0);
glRotatef(90.0, 1.0, 0.0, 0.0);
glPopMatrix();
glutWireSphere(1.0, 12, 12);
glFlush();
}
void changeSize(int w, int h)
{
if(h==0)
h=1;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0, 0, w, h);
gluPerspective(45, (float)w/h, 1, 1000);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(0.0,0.0,5.0,
0.0,0.0,-1.0,
0.0f,1.0f,0.0f);
}
int main(int argc, char *argv[])
{
glutInit(&argc, argv);
glutInitWindowPosition(-1, -1);
glutInitWindowSize(1024, 768);
glutInitDisplayMode(GLUT_RGB | GLUT_SINGLE | GLUT_DEPTH);
glutCreateWindow("Globe");
glutDisplayFunc(renderScene);
glutReshapeFunc(changeSize);
glutMainLoop();
return 0;
}
I didnt include the #include files, you should know what they are anyway.
Thank you