X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=progs%2Ftest-shapes-gles1%2Ftest-shapes-gles1.c;h=d55e0c6315b55b8f0dadf37797b7bf84858d7a37;hb=4a451851ec51ea7c3b79534fa5faebadceedf4df;hp=56b3569e3a0ba4b956d052e54079b3068aa9eb0f;hpb=8c3eab0efb7f82a94014e0c1342c287e19461041;p=freeglut diff --git a/progs/test-shapes-gles1/test-shapes-gles1.c b/progs/test-shapes-gles1/test-shapes-gles1.c index 56b3569..d55e0c6 100644 --- a/progs/test-shapes-gles1/test-shapes-gles1.c +++ b/progs/test-shapes-gles1/test-shapes-gles1.c @@ -37,6 +37,7 @@ */ #include +#include #include #include @@ -281,25 +282,8 @@ const GLfloat high_shininess[] = { 100.0f }; /* Program entry point */ -int -main(int argc, char *argv[]) -{ - glutInitWindowSize(640,480); - glutInitWindowPosition(40,40); - glutInit(&argc, argv); - glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE); - - glutCreateWindow("FreeGLUT Shapes"); - - glutReshapeFunc(resize); - glutDisplayFunc(display); - glutKeyboardFunc(key); - glutSpecialFunc(special); - glutIdleFunc(idle); - glutMouseFunc(onMouseClick); - - glutSetOption ( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION ) ; - +void init_context() { + printf("init_context\n"); fflush(stdout); glClearColor(1,1,1,1); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); @@ -320,6 +304,27 @@ main(int argc, char *argv[]) glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, high_shininess); +} + +int +main(int argc, char *argv[]) +{ + glutInitWindowSize(640,480); + glutInitWindowPosition(40,40); + glutInit(&argc, argv); + glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH | GLUT_MULTISAMPLE); + + glutCreateWindow("FreeGLUT Shapes"); + + glutReshapeFunc(resize); + glutDisplayFunc(display); + glutKeyboardFunc(key); + glutSpecialFunc(special); + glutIdleFunc(idle); + glutMouseFunc(onMouseClick); + glutInitContextFunc(init_context); + + glutSetOption ( GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_CONTINUE_EXECUTION ) ; glutMainLoop();