PDA

View Full Version : Window not showing up



Vlasko
02-10-2002, 03:58 AM
i have a problem with Glut when compiling everything seems ok but when i execute the program the main window(opengl) is not shown
code:

void initGL()
{
glShadeModel(GL_SMOOTH);
glClearColor(0.0f,0.0f,0.0f,1.0f);
glClearDepth(1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT,GL_NICEST);
if(!initVrchol()) exit(1);
}

int main(int argc, char **argv)
{
glutInit(&argc,argv);
glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH);
glutInitWindowPosition(10,10);
glutInitWindowSize(629,469);
glutCreateWindow("povrch");
initGL();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glutDisplayFunc(display);
//glutIdleFunc(idle);
//glutKeyboardFunc(keyb);
glutMainLoop();
return 0;
}

Leyder Dylan
02-10-2002, 09:24 AM
I don't know if this window size is supported :

glutInitWindowSize(629,469);

Change with

glutInitWindowSize(640,480);

marcus256
02-10-2002, 11:20 AM
Check out GLFW instead:
http://hem.passagen.se/opengl/glfw/

At least for me, it makes a whole lot more sense than GLUT when it comes to window handling (personal opinion, I wrote GLFW...).