Exemple #1
0
static void fghShSurfaceConfigure( void* data,
                                struct wl_shell_surface* shsurface,
                                uint32_t edges,
                                int32_t width, int32_t height )
{
    SFG_Window* window = data;
    fgPlatformReshapeWindow( window, width, height );
}
Exemple #2
0
void fgPlatformPosResZordWork( SFG_Window* window, unsigned int workMask )
{
    if( workMask & GLUT_FULL_SCREEN_WORK )
        fgPlatformFullScreenToggle( window );
    if( workMask & GLUT_POSITION_WORK )
        fgPlatformPositionWindow( window, window->State.DesiredXpos, window->State.DesiredYpos );
    if( workMask & GLUT_SIZE_WORK )
        fgPlatformReshapeWindow ( window, window->State.DesiredWidth, window->State.DesiredHeight );
    if( workMask & GLUT_ZORDER_WORK )
    {
        if( window->State.DesiredZOrder < 0 )
            fgPlatformPushWindow( window );
        else
            fgPlatformPopWindow( window );
    }
}
Exemple #3
0
static int fghToggleFullscreen(void)
{
    SFG_Window* win = fgStructure.CurrentWindow;

    if ( ! win->State.IsFullscreen )
    {
      win->State.pWState.OldWidth = win->State.Width;
      win->State.pWState.OldHeight = win->State.Height;
      wl_shell_surface_set_fullscreen( win->Window.pContext.shsurface,
                                       WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
                                       0, NULL );
    }
    else
    {
      fgPlatformReshapeWindow( win, win->State.pWState.OldWidth,
                                    win->State.pWState.OldHeight );
      wl_shell_surface_set_toplevel( win->Window.pContext.shsurface );
    }

    return 0;
}
Exemple #4
0
static void fghReshapeWindow ( SFG_Window *window, int width, int height )
{
    SFG_Window *current_window = fgStructure.CurrentWindow;

    freeglut_return_if_fail( window != NULL );

	fgPlatformReshapeWindow ( window, width, height );

    /*
     * Force a window redraw.  In Windows at least this is only a partial
     * solution:  if the window is increasing in size in either dimension,
     * the already-drawn part does not get drawn again and things look funny.
     * But without this we get this bad behaviour whenever we resize the
     * window.
     * DN: Hmm.. the above sounds like a concern only in single buffered mode...
     */
    window->State.Redisplay = GL_TRUE;

    if( window->IsMenu )
        fgSetWindow( current_window );
}