/* * This private function creates, opens and adds to the hierarchy * a freeglut window complete with OpenGL context and stuff... * * If parent is set to NULL, the window created will be a topmost one. */ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, GLboolean positionUse, int x, int y, GLboolean sizeUse, int w, int h, GLboolean gameMode, GLboolean isMenu ) { /* Have the window object created */ SFG_Window *window = (SFG_Window *)calloc( sizeof(SFG_Window), 1 ); #if TARGET_HOST_UNIX_X11 window->Window.FBConfig = NULL; #endif fghClearCallBacks( window ); /* Initialize the object properties */ window->ID = ++fgStructure.WindowID; #if TARGET_HOST_POSIX_X11 window->State.OldHeight = window->State.OldWidth = -1; #endif fgListInit( &window->Children ); if( parent ) { fgListAppend( &parent->Children, &window->Node ); window->Parent = parent; } else fgListAppend( &fgStructure.Windows, &window->Node ); /* Set the default mouse cursor and reset the modifiers value */ window->State.Cursor = GLUT_CURSOR_INHERIT; window->IsMenu = isMenu; window->State.IgnoreKeyRepeat = GL_FALSE; window->State.KeyRepeating = GL_FALSE; window->State.IsFullscreen = GL_FALSE; /* * Open the window now. The fgOpenWindow() function is system * dependant, and resides in freeglut_window.c. Uses fgState. */ fgOpenWindow( window, title, positionUse, x, y, sizeUse, w, h, gameMode, (GLboolean)(parent ? GL_TRUE : GL_FALSE) ); return window; }
/* * This private function creates, opens and adds to the hierarchy * a freeglut window complete with OpenGL context and stuff... * * If parent is set to NULL, the window created will be a topmost one. */ SFG_Window* fgCreateWindow( SFG_Window* parent, const char* title, GLboolean positionUse, int x, int y, GLboolean sizeUse, int w, int h, GLboolean gameMode, GLboolean isMenu ) { /* Have the window object created */ SFG_Window *window = (SFG_Window *)calloc( 1, sizeof(SFG_Window) ); fgPlatformCreateWindow ( window ); fghClearCallBacks( window ); SET_WCB( *window, Reshape, fghDefaultReshape); /* Initialize the object properties */ window->ID = ++fgStructure.WindowID; fgListInit( &window->Children ); if( parent ) { fgListAppend( &parent->Children, &window->Node ); window->Parent = parent; } else fgListAppend( &fgStructure.Windows, &window->Node ); /* Set the default mouse cursor */ window->State.Cursor = GLUT_CURSOR_INHERIT; /* Mark window as menu if a menu is to be created */ window->IsMenu = isMenu; /* * Open the window now. The fgOpenWindow() function is system * dependant, and resides in freeglut_window.c. Uses fgState. */ fgOpenWindow( window, title, positionUse, x, y, sizeUse, w, h, gameMode, (GLboolean)(parent ? GL_TRUE : GL_FALSE) ); return window; }