Exemple #1
0
/*
 * This function re-creates the window assets if they
 * have been destroyed
 */
void fgPlatformShowWindow( SFG_Window *window )
{
    if ( ! window->Window.pContext.egl_window ||
         ! window->Window.pContext.shsurface ||
         ! window->Window.pContext.surface)
    {
        fgPlatformCloseWindow( window );
        fgPlatformOpenWindow( window, "", /* TODO : save the title for further use */
                              GL_TRUE, window->State.Xpos, window->State.Ypos,
                              GL_TRUE, window->State.Width, window->State.Height,
                              (GLboolean)(window->State.IsFullscreen ? GL_TRUE : GL_FALSE),
                              (GLboolean)(window->Parent ? GL_TRUE : GL_FALSE) );
    }
    else 
    {
    /*     TODO : support this once we start using xdg-shell
     *
     *     xdg_surface_present( window->Window.pContext.shsurface, 0 );
     *     INVOKE_WCB( *window, WindowStatus, ( GLUT_FULLY_RETAINED ) );
     *     window->State.Visible = GL_TRUE;
     */
        fgWarning( "glutShownWindow(): function unsupported for an already existing"
                                     " window under Wayland" );
    }
}
Exemple #2
0
/*
 * Closes a window, destroying the frame and OpenGL context
 */
void fgCloseWindow( SFG_Window* window )
{
    /* if we're in gamemode and we're closing the gamemode window,
     * call glutLeaveGameMode first to make sure the gamemode is
     * properly closed before closing the window
     */
    if (fgStructure.GameModeWindow != NULL && fgStructure.GameModeWindow->ID==window->ID)
        glutLeaveGameMode();

	fgPlatformCloseWindow ( window );
}