Пример #1
0
int _glfwPlatformTerminate(void)
{
    if (_glfwLibrary.X11.cursor)
    {
        XFreeCursor(_glfwLibrary.X11.display, _glfwLibrary.X11.cursor);
        _glfwLibrary.X11.cursor = (Cursor) 0;
    }

    _glfwTerminateGammaRamp();

    terminateDisplay();

    _glfwTerminateJoysticks();

    // Unload libGL.so if necessary
#ifdef _GLFW_DLOPEN_LIBGL
    if (_glfwLibrary.GLX.libGL != NULL)
    {
        dlclose(_glfwLibrary.GLX.libGL);
        _glfwLibrary.GLX.libGL = NULL;
    }
#endif

    // Free clipboard memory
    if (_glfwLibrary.X11.selection.string)
        free(_glfwLibrary.X11.selection.string);

    return GL_TRUE;
}
Пример #2
0
void Engine::handleCommand(int32_t cmd)
{
	LOGD("At handleCommand()");

	switch (cmd) {
	        case APP_CMD_SAVE_STATE:
	            saveState();
	            break;
	        case APP_CMD_INIT_WINDOW:
	            // The window is being shown, get it ready.
	            if (app->window != NULL) {
	                initDisplay();
	                drawFrame();
	            }
	            break;
	        case APP_CMD_TERM_WINDOW:
	            // The window is being hidden or closed, clean it up.
	            terminateDisplay();
	            break;
	        case APP_CMD_GAINED_FOCUS:
	        	LOGD("At APP_CMD_GAINED_FOCUS");
	        	paused = false;
	            break;
	        case APP_CMD_LOST_FOCUS:
	        	LOGD("At APP_CMD_LOST_FOCUS");
	            // Also stop animating.
	            paused = true;
	            drawFrame();
	            break;
	    }
	return;
}
Пример #3
0
void _glfwPlatformTerminate(void)
{
    if (_glfw.x11.cursor)
    {
        XFreeCursor(_glfw.x11.display, _glfw.x11.cursor);
        _glfw.x11.cursor = (Cursor) 0;
    }

    free(_glfw.x11.selection.string);

    _glfwTerminateJoysticks();
    _glfwTerminateContextAPI();
    terminateDisplay();
}
Пример #4
0
int _glfwPlatformTerminate(void)
{
    if (_glfwLibrary.X11.cursor)
    {
        XFreeCursor(_glfwLibrary.X11.display, _glfwLibrary.X11.cursor);
        _glfwLibrary.X11.cursor = (Cursor) 0;
    }

    _glfwTerminateGammaRamp();

    _glfwTerminateJoysticks();

    _glfwTerminateOpenGL();

    terminateDisplay();

    // Free clipboard memory
    if (_glfwLibrary.X11.selection.string)
        free(_glfwLibrary.X11.selection.string);

    return GL_TRUE;
}