[Plib-cvs] plib/examples/src/pui simple.cxx,1.7,1.8
Brought to you by:
sjbaker
From: Sebastian U. <ud...@us...> - 2002-06-20 20:11:05
|
Update of /cvsroot/plib/plib/examples/src/pui In directory usw-pr-cvs1:/tmp/cvs-serv27017 Modified Files: simple.cxx Log Message: Undo of accidential merge Index: simple.cxx =================================================================== RCS file: /cvsroot/plib/plib/examples/src/pui/simple.cxx,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- simple.cxx 20 Jun 2002 20:07:55 -0000 1.7 +++ simple.cxx 20 Jun 2002 20:11:02 -0000 1.8 @@ -13,19 +13,19 @@ //#define VOODOO 1 -static void motionfn ( int x, int y ) +void motionfn ( int x, int y ) { puMouse ( x, y ) ; glutPostRedisplay () ; } -static void mousefn ( int button, int updown, int x, int y ) +void mousefn ( int button, int updown, int x, int y ) { puMouse ( button, updown, x, y ) ; glutPostRedisplay () ; } -static void displayfn ( void ) +void displayfn ( void ) { glClearColor ( 0.1f, 0.4f, 0.1f, 1.0f ) ; glClear ( GL_COLOR_BUFFER_BIT ) ; @@ -41,13 +41,13 @@ than creating user interface widgets, you normally do want to redraw your scenery as often as possible for smooth animation. */ - //glutPostRedisplay () ; + glutPostRedisplay () ; } -/*static void button_cb ( puObject * ) +void button_cb ( puObject * ) { fprintf ( stderr, "Hello World.\n" ) ; -}*/ +} int main ( int argc, char **argv ) @@ -67,23 +67,27 @@ can write their applications upon this example code without running into problems. */ - glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE /*| GLUT_DEPTH*/ ) ; + glutInitDisplayMode ( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH ) ; glutCreateWindow ( "PUI Application" ) ; glutDisplayFunc ( displayfn ) ; glutMouseFunc ( mousefn ) ; glutMotionFunc ( motionfn ) ; - glutPassiveMotionFunc ( motionfn ) ; -/*#ifdef VOODOO +#ifdef VOODOO glutPassiveMotionFunc ( motionfn ) ; -#endif*/ +#endif puInit () ; #ifdef VOODOO puShowCursor () ; #endif + + puOneShot *b = new puOneShot ( 50, 50, 200, 80 ) ; + + b -> setLegend ( "Say Hello" ) ; + b -> setCallback ( button_cb ) ; glutMainLoop () ; |