X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffg_callbacks.c;h=c62d37c71c3741ebbeead6c368f94c3a5216c0da;hb=bac05204a224d9cabe6b7d52c00d2e0601825cb4;hp=c83b3f0286cc78333406ed9962a2e5fb41ce6311;hpb=1897e7e46186c5aa11700a72cb3331c1aabdb360;p=freeglut diff --git a/src/fg_callbacks.c b/src/fg_callbacks.c index c83b3f0..c62d37c 100644 --- a/src/fg_callbacks.c +++ b/src/fg_callbacks.c @@ -121,7 +121,6 @@ void FGAPIENTRY glut##a##Func( FGCB##b callback ) \ #define IMPLEMENT_CALLBACK_FUNC(a) IMPLEMENT_CALLBACK_FUNC_2NAME(a,a) /* Implement all these callback setter functions... */ -IMPLEMENT_CALLBACK_FUNC(Reshape); IMPLEMENT_CALLBACK_FUNC(Position); IMPLEMENT_CALLBACK_FUNC(Keyboard); IMPLEMENT_CALLBACK_FUNC(KeyboardUp); @@ -163,6 +162,21 @@ void FGAPIENTRY glutDisplayFunc( FGCBDisplay callback ) SET_CALLBACK( Display ); } +void fghDefaultReshape(int width, int height) +{ + glViewport( 0, 0, width, height ); +} + +void FGAPIENTRY glutReshapeFunc( FGCBReshape callback ) +{ + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutReshapeFunc" ); + + if( !callback ) + callback = fghDefaultReshape; + + SET_CALLBACK( Reshape ); +} + /* * Sets the Visibility callback for the current window. * NB: the Visibility func is deprecated in favor of the WindowStatus func,