diff --git a/examples/logo/logo.cpp b/examples/logo/logo.cpp index b8d3705..b7c839c 100644 --- a/examples/logo/logo.cpp +++ b/examples/logo/logo.cpp @@ -79,12 +79,7 @@ GLint ps2_list, gl_list, wet_list, circle_list, tri_list, square_list, x_list; int main(int argc, char** argv) { - int dummy_argc = 1; - char iop_module_path[] = "iop_module_path=host0:/usr/local/sce/iop/modules"; - char* dummy_argv[1]; - dummy_argv[0] = iop_module_path; - - glutInit(&dummy_argc, (char**)dummy_argv); + glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutCreateWindow(argv[0]); diff --git a/examples/nehe/lesson04/lesson4.cpp b/examples/nehe/lesson04/lesson4.cpp index 7923db9..58f974d 100644 --- a/examples/nehe/lesson04/lesson4.cpp +++ b/examples/nehe/lesson04/lesson4.cpp @@ -35,6 +35,11 @@ void init(GLvoid) // Create Some Everyday Functions glEnable(GL_LIGHT0); } +void frameEnd(void) { + // Swap The Buffers To Not Be Left With A Clear Screen + glutSwapBuffers(); +} + void display(void) // Create The Display Function { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer @@ -64,10 +69,6 @@ void display(void) // Create The Display Fu glPopMatrix(); rtri += 0.2f; // Increase The Rotation Variable For The Triangle ( NEW ) rquad -= 0.15f; // Decrease The Rotation Variable For The Quad ( NEW ) - - - glutSwapBuffers(); - // Swap The Buffers To Not Be Left With A Clear Screen } void reshape(int w, int h) // Create The Reshape Function (the viewport) @@ -92,7 +93,7 @@ int main(int argc, char **argv) // Create Main Function For Bri glutCreateWindow("NeHe's OpenGL Framework"); // Window Title (argv[0] for current directory as title) glutDisplayFunc(display); // Matching Earlier Functions To Their Counterparts glutReshapeFunc(reshape); - glutIdleFunc(display); + glutIdleFunc(frameEnd); glutMainLoop(); // Initialize The Main Loop return 0; diff --git a/examples/nehe/lesson05/lesson5.cpp b/examples/nehe/lesson05/lesson5.cpp index 17e0e59..fdfdeaa 100644 --- a/examples/nehe/lesson05/lesson5.cpp +++ b/examples/nehe/lesson05/lesson5.cpp @@ -35,6 +35,11 @@ void InitGL(GLvoid) // Create Some Everyday Functions glEnable(GL_LIGHT0); } +void frameEnd(void) { + // Swap The Buffers To Not Be Left With A Clear Screen + glutSwapBuffers(); +} + void display(void) // Create The Display Function { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Clear Screen And Depth Buffer @@ -109,10 +114,6 @@ void display(void) // Create The Display Fu glPopMatrix(); rtri += 0.2f; // Increase The Rotation Variable For The Triangle ( NEW ) rquad -= 0.15f; // Decrease The Rotation Variable For The Quad ( NEW ) - - - glutSwapBuffers(); - // Swap The Buffers To Not Be Left With A Clear Screen } void reshape(int width, int height) // Create The Reshape Function (the viewport) @@ -143,7 +144,7 @@ int main(int argc, char **argv) // Create Main Function For Br InitGL(); glutDisplayFunc(display); // Matching Earlier Functions To Their Counterparts glutReshapeFunc(reshape); - glutIdleFunc(display); + glutIdleFunc(frameEnd); glutMainLoop(); // Initialize The Main Loop return 0;