From 610a5078f144e873cc962bc9e3dc3cf8709831bc Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Thu, 5 Apr 2012 22:40:18 +0100 Subject: [PATCH] [Add] Finished GLWindow::Destory method. --- src/Main/GLWindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Main/GLWindow.cpp b/src/Main/GLWindow.cpp index 764b29d..3afcf65 100644 --- a/src/Main/GLWindow.cpp +++ b/src/Main/GLWindow.cpp @@ -177,10 +177,13 @@ bool GLWindow::Create(int width, int height, int bpp, bool fullscreen) { void GLWindow::Destroy(void) { if(_glContext) { - // Some code here. + glXMakeCurrent(_display, None, NULL); + glXDestroyContext(_display, _glContext); + _glContext = NULL; } if(_isFullscreen) { - // And here.. + XF86VidModeSwitchToMode(_display, _screeID, &_XF86DeskMode); + XF86VidModeSetViewPort(_display, _screenID, 0, 0); } XCloseDisplay(_display);