X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_state.c;h=c972713c1a0507706e48fdf16b5dcaf71eed29dd;hb=4634982c39857ee13ad0c5fa67b3ad197a37daf1;hp=cf478a89a2f15dbd8648bd090800b6a9a4f9654b;hpb=f5bee040bbdedfec9c90fd211d302962bfd3aab9;p=freeglut diff --git a/src/freeglut_state.c b/src/freeglut_state.c index cf478a8..c972713 100644 --- a/src/freeglut_state.c +++ b/src/freeglut_state.c @@ -25,10 +25,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - #include #include "freeglut_internal.h" @@ -72,7 +68,7 @@ static int fghGetConfig( int attribute ) */ void FGAPIENTRY glutSetOption( GLenum eWhat, int value ) { - freeglut_assert_ready; + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutSetOption" ); /* * XXX In chronological code add order. (WHY in that order?) @@ -142,7 +138,7 @@ int FGAPIENTRY glutGet( GLenum eWhat ) return fgElapsedTime(); } - freeglut_assert_ready; + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGet" ); /* XXX In chronological code add order. (WHY in that order?) */ switch( eWhat ) @@ -465,7 +461,7 @@ int FGAPIENTRY glutGet( GLenum eWhat ) */ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) { - freeglut_assert_ready; + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutDeviceGet" ); /* XXX WARNING: we are mostly lying in this function. */ switch( eWhat ) @@ -537,7 +533,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) case GLUT_JOYSTICK_POLL_RATE: return fgStructure.Window ? fgStructure.Window->State.JoystickPollRate : 0; - /* The following two are only for Joystick 0 but this is an improvement */ + /* XXX The following two are only for Joystick 0 but this is an improvement */ case GLUT_JOYSTICK_BUTTONS: return glutJoystickGetNumButtons ( 0 ); @@ -559,8 +555,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) return fgStructure.Window ? fgStructure.Window->State.IgnoreKeyRepeat : 0; case GLUT_DEVICE_KEY_REPEAT: - /* XXX WARNING: THIS IS A BIG LIE! */ - return GLUT_KEY_REPEAT_DEFAULT; + return fgState.KeyRepeat; default: fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat ); @@ -576,6 +571,7 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) */ int FGAPIENTRY glutGetModifiers( void ) { + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutGetModifiers" ); if( fgState.Modifiers == 0xffffffff ) { fgWarning( "glutGetModifiers() called outside an input callback" ); @@ -590,7 +586,7 @@ int FGAPIENTRY glutGetModifiers( void ) */ int FGAPIENTRY glutLayerGet( GLenum eWhat ) { - freeglut_assert_ready; + FREEGLUT_EXIT_IF_NOT_INITIALISED ( "glutLayerGet" ); /* * This is easy as layers are not implemented ;-)