git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@357
7f0cb862-5218-0410-a997-
914c9d46530a
GL_FALSE, /* GLDebugSwitch */
GL_FALSE, /* XSyncSwitch */
GL_TRUE, /* IgnoreKeyRepeat */
GL_FALSE, /* GLDebugSwitch */
GL_FALSE, /* XSyncSwitch */
GL_TRUE, /* IgnoreKeyRepeat */
+ 0xffffffff, /* Modifiers */
0, /* FPSInterval */
0, /* SwapCount */
0, /* SwapTime */
0, /* FPSInterval */
0, /* SwapCount */
0, /* SwapTime */
72, /* GameModeRefresh */
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
GLUT_EXEC_STATE_INIT /* ExecState */
72, /* GameModeRefresh */
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
GLUT_EXEC_STATE_INIT /* ExecState */
+ NULL, /* ProgramName */
fgState.ExecState = GLUT_EXEC_STATE_INIT;
fgState.IgnoreKeyRepeat = GL_TRUE;
fgState.ExecState = GLUT_EXEC_STATE_INIT;
fgState.IgnoreKeyRepeat = GL_TRUE;
+ fgState.Modifiers = 0xffffffff;
fgState.GameModeSize.X = 640;
fgState.GameModeSize.Y = 480;
fgState.GameModeSize.X = 640;
fgState.GameModeSize.Y = 480;
char* geometry = NULL;
int i, j, argc = *pargc;
char* geometry = NULL;
int i, j, argc = *pargc;
+ if( fgState.Initalized )
+ fgError( "illegal glutInit() reinitialization attemp" );
+
if (pargc && *pargc && argv && *argv && **argv)
if (pargc && *pargc && argv && *argv && **argv)
fgState.ProgramName = strdup (*argv);
fgState.ProgramName = strdup (*argv);
- else
- fgState.ProgramName = strdup ("");
- if( !fgState.ProgramName )
- fgError ("Could not allocate space for the program's name.");
- if( fgState.Initalized )
- fgError( "illegal glutInit() reinitialization attemp" );
+ if( !fgState.ProgramName )
+ fgError ("Could not allocate space for the program's name.");
+ }
GLboolean XSyncSwitch; /* X11 sync protocol switch */
GLboolean IgnoreKeyRepeat; /* Whether to ignore key repeat. */
GLboolean XSyncSwitch; /* X11 sync protocol switch */
GLboolean IgnoreKeyRepeat; /* Whether to ignore key repeat. */
+ int Modifiers; /* Current ALT/SHIFT/CTRL state */
GLuint FPSInterval; /* Interval between FPS printfs */
GLuint SwapCount; /* Count of glutSwapBuffer calls */
GLuint FPSInterval; /* Interval between FPS printfs */
GLuint SwapCount; /* Count of glutSwapBuffer calls */
GLboolean Visible; /* Is the window visible now */
int Cursor; /* The currently selected cursor */
GLboolean Visible; /* Is the window visible now */
int Cursor; /* The currently selected cursor */
- int Modifiers; /* The current ALT/SHIFT/CTRL state */
long JoystickPollRate; /* The joystick polling rate */
long JoystickLastPoll; /* When the last poll has happened */
long JoystickPollRate; /* The joystick polling rate */
long JoystickLastPoll; /* When the last poll has happened */
/*
* XXX Why don't we use {window}? Other code here does...
*/
/*
* XXX Why don't we use {window}? Other code here does...
*/
- fgStructure.Window->State.Modifiers = fgGetXModifiers( &event );
+ fgState.Modifiers = fgGetXModifiers( &event );
/*
* Finally execute the mouse or mouse wheel callback
/*
* Finally execute the mouse or mouse wheel callback
/*
* Trash the modifiers state
*/
/*
* Trash the modifiers state
*/
- fgStructure.Window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
if( keyboard_cb )
{
fgSetWindow( window );
if( keyboard_cb )
{
fgSetWindow( window );
- window->State.Modifiers = fgGetXModifiers( &event );
+ fgState.Modifiers = fgGetXModifiers( &event );
keyboard_cb( asciiCode[ 0 ],
event.xkey.x, event.xkey.y
);
keyboard_cb( asciiCode[ 0 ],
event.xkey.x, event.xkey.y
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
if( special_cb && ( special != -1 ) )
{
fgSetWindow( window );
if( special_cb && ( special != -1 ) )
{
fgSetWindow( window );
- window->State.Modifiers = fgGetXModifiers( &event );
+ fgState.Modifiers = fgGetXModifiers( &event );
special_cb( special, event.xkey.x, event.xkey.y );
special_cb( special, event.xkey.x, event.xkey.y );
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
- window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
if( ( wParam & MK_LBUTTON ) ||
( wParam & MK_MBUTTON ) ||
if( ( wParam & MK_LBUTTON ) ||
( wParam & MK_MBUTTON ) ||
INVOKE_WCB( *window, Passive, ( window->State.MouseX,
window->State.MouseY ) );
INVOKE_WCB( *window, Passive, ( window->State.MouseX,
window->State.MouseY ) );
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
break;
fgSetWindow( window );
break;
fgSetWindow( window );
- fgStructure.Window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
INVOKE_WCB(
*window, Mouse,
INVOKE_WCB(
*window, Mouse,
- fgStructure.Window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
break;
fgSetWindow( window );
break;
fgSetWindow( window );
- fgStructure.Window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
while( ticks-- )
if( FETCH_WCB( *window, MouseWheel ) )
while( ticks-- )
if( FETCH_WCB( *window, MouseWheel ) )
- fgStructure.Window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
* Remember the current modifiers state. This is done here in order
* to make sure the VK_DELETE keyboard callback is executed properly.
*/
* Remember the current modifiers state. This is done here in order
* to make sure the VK_DELETE keyboard callback is executed properly.
*/
- window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
GetCursorPos( &mouse_pos );
ScreenToClient( window->Window.Handle, &mouse_pos );
GetCursorPos( &mouse_pos );
ScreenToClient( window->Window.Handle, &mouse_pos );
window->State.MouseX, window->State.MouseY )
);
window->State.MouseX, window->State.MouseY )
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
* Remember the current modifiers state. This is done here in order
* to make sure the VK_DELETE keyboard callback is executed properly.
*/
* Remember the current modifiers state. This is done here in order
* to make sure the VK_DELETE keyboard callback is executed properly.
*/
- window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
GetCursorPos( &mouse_pos );
ScreenToClient( window->Window.Handle, &mouse_pos );
GetCursorPos( &mouse_pos );
ScreenToClient( window->Window.Handle, &mouse_pos );
window->State.MouseX, window->State.MouseY )
);
window->State.MouseX, window->State.MouseY )
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
*/
if( FETCH_WCB( *window, Keyboard ) )
{
*/
if( FETCH_WCB( *window, Keyboard ) )
{
- window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
INVOKE_WCB( *window, Keyboard,
( (char)wParam,
window->State.MouseX, window->State.MouseY )
);
INVOKE_WCB( *window, Keyboard,
( (char)wParam,
window->State.MouseX, window->State.MouseY )
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
*/
int FGAPIENTRY glutGetModifiers( void )
{
*/
int FGAPIENTRY glutGetModifiers( void )
{
- if( fgStructure.Window == NULL )
- return( 0 );
-
- if( fgStructure.Window->State.Modifiers == 0xffffffff )
+ if( fgState.Modifiers == 0xffffffff )
{
fgWarning( "glutGetModifiers() called outside an input callback" );
return( 0 );
}
{
fgWarning( "glutGetModifiers() called outside an input callback" );
return( 0 );
}
- return( fgStructure.Window->State.Modifiers );
+ return( fgState.Modifiers );
* Set the default mouse cursor and reset the modifiers value
*/
window->State.Cursor = GLUT_CURSOR_INHERIT;
* Set the default mouse cursor and reset the modifiers value
*/
window->State.Cursor = GLUT_CURSOR_INHERIT;
- window->State.Modifiers = 0xffffffff;