- if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_FORMAT, &screenFormat)) {
- screen_destroy_window(sWindow);
- screen_destroy_context(window->Window.pContext.screenContext);
- fgError("Could not set window format");
- return;
- }
- if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_USAGE, &screenUsage)) {
- screen_destroy_window(sWindow);
- screen_destroy_context(window->Window.pContext.screenContext);
- fgError("Could not set window usage");
- return;
- }
-
- /* Could set size based on what is specified for window. Work on another time
- int size[2];
- size[0] = w;
- size[1] = h;
- if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_BUFFER_SIZE, size)) {
- screen_destroy_window(sWindow);
- screen_destroy_context(window->Window.pContext.screenContext);
- fgError("Could not set window buffer size");
- return;
- }*/
-
- /* Create window buffers */
- if (screen_create_window_buffers(sWindow, 2)) {
- screen_destroy_window(sWindow);
- screen_destroy_context(window->Window.pContext.screenContext);
- fgError("Could not create window buffers");
- return;
- }
-
- /* Request window events */
- screen_request_events(window->Window.pContext.screenContext);
-
- /* Save window */
- window->Window.Handle = fgDisplay.pDisplay.single_native_window;
- window->State.WorkMask |= GLUT_INIT_WORK;
-
- /* Create context */
- fghChooseConfig(&window->Window.pContext.egl.Config);
- window->Window.Context = fghCreateNewContextEGL(window);
-
- /* Create EGL window */
- fghPlatformOpenWindowEGL(window);
-
- window->State.Visible = GL_TRUE;
+ if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_FORMAT, &screenFormat)) {
+ screen_destroy_window(sWindow);
+ fgError("Could not set window format");
+ return;
+ }
+ if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_USAGE, &screenUsage)) {
+ screen_destroy_window(sWindow);
+ fgError("Could not set window usage");
+ return;
+ }
+
+ /* Could set size based on what is specified for window. Work on another time
+ int size[2];
+ size[0] = w;
+ size[1] = h;
+ if (screen_set_window_property_iv(sWindow, SCREEN_PROPERTY_BUFFER_SIZE, size)) {
+ screen_destroy_window(sWindow);
+ fgError("Could not set window buffer size");
+ return;
+ }*/
+
+ /* Create window buffers */
+ if (screen_create_window_buffers(sWindow, (fgState.DisplayMode & GLUT_DOUBLE) ? 2 : 1)) {
+ screen_destroy_window(sWindow);
+ fgError("Could not create window buffers");
+ return;
+ }
+
+ /* Save window and set state */
+ window->Window.Handle = fgDisplay.pDisplay.single_native_window;
+ window->State.WorkMask |= GLUT_INIT_WORK;
+ window->State.IsFullscreen = GL_TRUE; //XXX Always fullscreen for now
+
+ /* Create context */
+ fghChooseConfig(&window->Window.pContext.egl.Config);
+ window->Window.Context = fghCreateNewContextEGL(window);
+
+ /* Create EGL window */
+ fghPlatformOpenWindowEGL(window);
+
+ window->State.Visible = GL_TRUE;