コード例 #1
0
ファイル: x11_window.c プロジェクト: jjiezheng/lfant
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (window->monitor)
        leaveFullscreenMode(window);

    _glfwDestroyContext(window);

    if (window->x11.handle)
    {
        if (window->x11.handle ==
            XGetSelectionOwner(_glfw.x11.display, _glfw.x11.CLIPBOARD))
        {
            _glfwPushSelectionToManager(window);
        }

        XDeleteContext(_glfw.x11.display, window->x11.handle, _glfw.x11.context);
        XUnmapWindow(_glfw.x11.display, window->x11.handle);
        XDestroyWindow(_glfw.x11.display, window->x11.handle);
        window->x11.handle = (Window) 0;
    }

    if (window->x11.colormap)
    {
        XFreeColormap(_glfw.x11.display, window->x11.colormap);
        window->x11.colormap = (Colormap) 0;
    }
}
コード例 #2
0
// Destroys the GLFW window and rendering context
//
static void destroyWindow(_GLFWwindow* window)
{
    _glfwDestroyContext(window);

    if (window->win32.handle)
    {
        DestroyWindow(window->win32.handle);
        window->win32.handle = NULL;
    }
}
コード例 #3
0
ファイル: win32_window.c プロジェクト: edensal/glfw
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (window->fullscreen)
        leaveFullscreenMode(window);

    if (window->context.api != GLFW_NO_API)
        _glfwDestroyContext(window);

    destroyWindow(window);
}
コード例 #4
0
ファイル: mir_window.c プロジェクト: odinsbane/glfw
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (mir_surface_is_valid(window->mir.surface))
    {
        mir_surface_release_sync(window->mir.surface);
        window->mir.surface = NULL;
    }

    _glfwDestroyContext(window);
}
コード例 #5
0
ファイル: wl_window.c プロジェクト: Delwin9999/glfw
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (window->wl.native)
        wl_egl_window_destroy(window->wl.native);

    _glfwDestroyContext(window);

    if (window->wl.shell_surface)
        wl_shell_surface_destroy(window->wl.shell_surface);

    if (window->wl.surface)
        wl_surface_destroy(window->wl.surface);
}
コード例 #6
0
ファイル: x11_window.c プロジェクト: Ape/DCPUToolchain
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (window->mode == GLFW_FULLSCREEN)
	leaveFullscreenMode(window);

    _glfwDestroyContext(window);

    if (window->X11.handle)
    {
	XUnmapWindow(_glfwLibrary.X11.display, window->X11.handle);
	XDestroyWindow(_glfwLibrary.X11.display, window->X11.handle);
	window->X11.handle = (Window) 0;
    }

    if (window->X11.colormap)
    {
	XFreeColormap(_glfwLibrary.X11.display, window->X11.colormap);
	window->X11.colormap = (Colormap) 0;
    }
}
コード例 #7
0
ファイル: x11_window.c プロジェクト: NathanSweet/glfw
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    if (window->monitor)
        leaveFullscreenMode(window);

    _glfwDestroyContext(window);

    if (window->x11.handle)
    {
        XUnmapWindow(_glfw.x11.display, window->x11.handle);
        XDestroyWindow(_glfw.x11.display, window->x11.handle);
        window->x11.handle = (Window) 0;
    }

    if (window->x11.colormap)
    {
        XFreeColormap(_glfw.x11.display, window->x11.colormap);
        window->x11.colormap = (Colormap) 0;
    }
}
コード例 #8
0
ファイル: win32_window.c プロジェクト: edensal/glfw
int _glfwPlatformCreateWindow(_GLFWwindow* window,
                              const _GLFWwndconfig* wndconfig,
                              const _GLFWctxconfig* ctxconfig,
                              const _GLFWfbconfig* fbconfig)
{
    int status;

    if (!createWindow(window, wndconfig))
        return GLFW_FALSE;

    if (ctxconfig->api != GLFW_NO_API)
    {
        if (!_glfwCreateContext(window, ctxconfig, fbconfig))
            return GLFW_FALSE;

#if defined(_GLFW_WGL)
        status = _glfwAnalyzeContext(window, ctxconfig, fbconfig);

        if (status == _GLFW_RECREATION_IMPOSSIBLE)
            return GLFW_FALSE;

        if (status == _GLFW_RECREATION_REQUIRED)
        {
            // Some window hints require us to re-create the context using WGL
            // extensions retrieved through the current context, as we cannot
            // check for WGL extensions or retrieve WGL entry points before we
            // have a current context (actually until we have implicitly loaded
            // the vendor ICD)

            // Yes, this is strange, and yes, this is the proper way on WGL

            // As Windows only allows you to set the pixel format once for
            // a window, we need to destroy the current window and create a new
            // one to be able to use the new pixel format

            // Technically, it may be possible to keep the old window around if
            // we're just creating an OpenGL 3.0+ context with the same pixel
            // format, but it's not worth the added code complexity

            // First we clear the current context (the one we just created)
            // This is usually done by glfwDestroyWindow, but as we're not doing
            // full GLFW window destruction, it's duplicated here
            _glfwPlatformMakeContextCurrent(NULL);

            // Next destroy the Win32 window and WGL context (without resetting
            // or destroying the GLFW window object)
            _glfwDestroyContext(window);
            destroyWindow(window);

            // ...and then create them again, this time with better APIs
            if (!createWindow(window, wndconfig))
                return GLFW_FALSE;
            if (!_glfwCreateContext(window, ctxconfig, fbconfig))
                return GLFW_FALSE;
        }
#endif // _GLFW_WGL
    }
    
    if (wndconfig->fullscreen)
    {
        _glfwPlatformShowWindow(window);
        if (!enterFullscreenMode(window))
            return GLFW_FALSE;
    }

    return GLFW_TRUE;
}
コード例 #9
0
ファイル: screen_window.c プロジェクト: adasworks/glfw
void _glfwPlatformDestroyWindow(_GLFWwindow* window)
{
    screen_destroy_window(window->screen.window);
    window->screen.window = NULL;
    _glfwDestroyContext(window);
}