projects
/
freeglut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
using FREE_GLUT_BUILD_STATIC_LIBS and FREEGLUT_BUILD_SHARED_LIBS instead of their...
[freeglut]
/
src
/
fg_structure.c
diff --git
a/src/fg_structure.c
b/src/fg_structure.c
index
7c2c143
..
d50063f
100644
(file)
--- a/
src/fg_structure.c
+++ b/
src/fg_structure.c
@@
-49,6
+49,7
@@
SFG_Structure fgStructure = { { NULL, NULL }, /* The list of windows */
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
extern void fgPlatformCreateWindow ( SFG_Window *window );
/* -- PRIVATE FUNCTIONS ---------------------------------------------------- */
extern void fgPlatformCreateWindow ( SFG_Window *window );
+extern void fghDefaultReshape(int width, int height);
static void fghClearCallBacks( SFG_Window *window )
{
static void fghClearCallBacks( SFG_Window *window )
{
@@
-72,11
+73,12
@@
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
GLboolean gameMode, GLboolean isMenu )
{
/* Have the window object created */
GLboolean gameMode, GLboolean isMenu )
{
/* Have the window object created */
- SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 );
+ SFG_Window *window = (SFG_Window *)calloc( 1, sizeof(SFG_Window) );
fgPlatformCreateWindow ( window );
fghClearCallBacks( window );
fgPlatformCreateWindow ( window );
fghClearCallBacks( window );
+ SET_WCB( *window, Reshape, fghDefaultReshape);
/* Initialize the object properties */
window->ID = ++fgStructure.WindowID;
/* Initialize the object properties */
window->ID = ++fgStructure.WindowID;
@@
-90,14
+92,11
@@
SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title,
else
fgListAppend( &fgStructure.Windows, &window->Node );
else
fgListAppend( &fgStructure.Windows, &window->Node );
- /* Set the default mouse cursor and reset the modifiers value */
+ /* Set the default mouse cursor */
window->State.Cursor = GLUT_CURSOR_INHERIT;
window->State.Cursor = GLUT_CURSOR_INHERIT;
- window->IsMenu = isMenu;
-
- window->State.IgnoreKeyRepeat = GL_FALSE;
- window->State.KeyRepeating = GL_FALSE;
- window->State.IsFullscreen = GL_FALSE;
+ /* Mark window as menu if a menu is to be created */
+ window->IsMenu = isMenu;
/*
* Open the window now. The fgOpenWindow() function is system
/*
* Open the window now. The fgOpenWindow() function is system
@@
-534,7
+533,7
@@
static void fghcbMenuByID( SFG_Menu *menu,
return;
/* Check the menu's ID. */
return;
/* Check the menu's ID. */
- if( menu->ID == (int)(enumerator->data) )
+ if( menu->ID == *( int *)(enumerator->data) )
{
enumerator->found = GL_TRUE;
enumerator->data = menu;
{
enumerator->found = GL_TRUE;
enumerator->data = menu;
@@
-553,7
+552,7
@@
SFG_Menu* fgMenuByID( int menuID )
/* This is easy and makes use of the menus enumeration defined above */
enumerator.found = GL_FALSE;
/* This is easy and makes use of the menus enumeration defined above */
enumerator.found = GL_FALSE;
- enumerator.data = (void *)menuID;
+ enumerator.data = (void *)&menuID;
fgEnumMenus( fghcbMenuByID, &enumerator );
if( enumerator.found )
fgEnumMenus( fghcbMenuByID, &enumerator );
if( enumerator.found )