X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_state.c;h=62d4f896e77de3a4543be4821ace65b2ad86f427;hb=c24efb9241080a043193b67c6a9718312fed8d07;hp=68b7eb5838df2b8dc840f711dee9f317ecb3e68f;hpb=3c01ae4a03820398f92e3010e75e9f228be1b8b4;p=freeglut diff --git a/src/freeglut_state.c b/src/freeglut_state.c index 68b7eb5..62d4f89 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,7 +555,8 @@ int FGAPIENTRY glutDeviceGet( GLenum eWhat ) return fgStructure.Window ? fgStructure.Window->State.IgnoreKeyRepeat : 0; case GLUT_DEVICE_KEY_REPEAT: - return fgState.KeyRepeat; + /* XXX WARNING: THIS IS A BIG LIE! */ + return GLUT_KEY_REPEAT_DEFAULT; default: fgWarning( "glutDeviceGet(): missing enum handle %d", eWhat ); @@ -575,6 +572,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" ); @@ -589,7 +587,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 ;-)