GL_FALSE, /* GLDebugSwitch */
GL_FALSE, /* XSyncSwitch */
GL_TRUE, /* IgnoreKeyRepeat */
+ 0xffffffff, /* Modifiers */
0, /* FPSInterval */
0, /* SwapCount */
0, /* SwapTime */
72, /* GameModeRefresh */
GLUT_ACTION_EXIT, /* ActionOnWindowClose */
GLUT_EXEC_STATE_INIT /* ExecState */
+ NULL, /* ProgramName */
};
fgState.ExecState = GLUT_EXEC_STATE_INIT;
fgState.IgnoreKeyRepeat = GL_TRUE;
+ fgState.Modifiers = 0xffffffff;
fgState.GameModeSize.X = 640;
fgState.GameModeSize.Y = 480;
char* geometry = NULL;
int i, j, argc = *pargc;
+ if( fgState.Initalized )
+ fgError( "illegal glutInit() reinitialization attemp" );
+
if (pargc && *pargc && argv && *argv && **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.");
+ }
fgCreateStructure( );
/*
* 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
/*
* Trash the modifiers state
*/
- fgStructure.Window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
break;
if( keyboard_cb )
{
fgSetWindow( window );
- window->State.Modifiers = fgGetXModifiers( &event );
+ fgState.Modifiers = fgGetXModifiers( &event );
keyboard_cb( asciiCode[ 0 ],
event.xkey.x, event.xkey.y
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
}
else
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 );
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
}
}
break;
}
- window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
if( ( wParam & MK_LBUTTON ) ||
( wParam & MK_MBUTTON ) ||
INVOKE_WCB( *window, Passive, ( window->State.MouseX,
window->State.MouseY ) );
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
break;
break;
fgSetWindow( window );
- fgStructure.Window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
INVOKE_WCB(
*window, Mouse,
)
);
- fgStructure.Window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
break;
break;
fgSetWindow( window );
- fgStructure.Window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
while( ticks-- )
if( FETCH_WCB( *window, MouseWheel ) )
);
}
- fgStructure.Window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
break;
* 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 );
window->State.MouseX, window->State.MouseY )
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
break;
* 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 );
window->State.MouseX, window->State.MouseY )
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
break;
*/
if( FETCH_WCB( *window, Keyboard ) )
{
- window->State.Modifiers = fgGetWin32Modifiers( );
+ fgState.Modifiers = fgGetWin32Modifiers( );
INVOKE_WCB( *window, Keyboard,
( (char)wParam,
window->State.MouseX, window->State.MouseY )
);
- window->State.Modifiers = 0xffffffff;
+ fgState.Modifiers = 0xffffffff;
}
}
break;