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
/*
 * Opens a window. Requires a SFG_Window object created and attached
 * to the freeglut structure. OpenGL context is created here.
 */
void fgOpenWindow( SFG_Window* window, const char* title,
                   GLboolean positionUse, int x, int y,
                   GLboolean sizeUse, int w, int h,
                   GLboolean gameMode, GLboolean isSubWindow )
{
	fgPlatformOpenWindow( window, title,
                   positionUse, x, y,
                   sizeUse, w, h,
                   gameMode, isSubWindow );

    fgSetWindow( window );

    window->Window.DoubleBuffered =
        ( fgState.DisplayMode & GLUT_DOUBLE ) ? 1 : 0;

#ifndef EGL_VERSION_1_0  /* No glDrawBuffer/glReadBuffer in GLES */
    if ( ! window->Window.DoubleBuffered )
    {
        glDrawBuffer ( GL_FRONT );
        glReadBuffer ( GL_FRONT );
    }
#endif
    window->Window.attribute_v_coord = -1;
    window->Window.attribute_v_normal = -1;

    fgInitGL2();

    window->State.NeedToInitContext = GL_TRUE;
}