From 0325f55d682442a20dba064c1ae4ae4af56009b5 Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Fri, 15 Aug 2008 12:03:49 +0000 Subject: [PATCH] Some more fixes for GL plugin, getting ready for AA, and maybe some proper cleanup of XWindow in Linux, which we will never know if it works. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@220 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp | 6 ++++-- Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp index 8a85fb51f5..f6e67cad80 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp @@ -270,7 +270,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight int glxMajorVersion, glxMinorVersion; int vidModeMajorVersion, vidModeMinorVersion; Atom wmDelete; - + // attributes for a single buffered visual in RGBA format with at least // 8 bits per color and a 24 bit depth buffer int attrListSgl[] = {GLX_RGBA, GLX_RED_SIZE, 8, @@ -286,7 +286,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight GLX_GREEN_SIZE, 8, GLX_BLUE_SIZE, 8, GLX_DEPTH_SIZE, 24, - None }; + GLX_SAMPLE_BUFFERS_ARB, 1, GLX_SAMPLES_ARB, 1, None }; GLWin.dpy = XOpenDisplay(0); g_VideoInitialize.pWindowHandle = (HWND)GLWin.dpy; GLWin.screen = DefaultScreen(GLWin.dpy); @@ -533,7 +533,9 @@ void OpenGL_Shutdown() { ERROR_LOG("Could not release drawing context.\n"); } + XUnmapWindow(GLWin.dpy, GLWin.win); glXDestroyContext(GLWin.dpy, GLWin.ctx); + XCloseDisplay(GLWin.dpy); GLWin.ctx = NULL; } /* switch back to original desktop resolution if we were in fs */ diff --git a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp index 85b18f8fb0..37b868f615 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/TextureMngr.cpp @@ -527,10 +527,10 @@ void TextureMngr::CopyRenderTargetToTexture(u32 address, bool bFromZBuffer, bool GL_REPORT_ERRORD(); glBegin(GL_QUADS); - glTexCoord2f((float)source->left, Renderer::GetTargetHeight()-(float)source->bottom); glVertex2f(-1,1); - glTexCoord2f((float)source->left, Renderer::GetTargetHeight()-(float)source->top); glVertex2f(-1,-1); - glTexCoord2f((float)source->right, Renderer::GetTargetHeight()-(float)source->top); glVertex2f(1,-1); - glTexCoord2f((float)source->right, Renderer::GetTargetHeight()-(float)source->bottom); glVertex2f(1,1); + glTexCoord2f((float)source->left * MValue, Renderer::GetTargetHeight()-(float)source->bottom * MValue); glVertex2f(-1,1); + glTexCoord2f((float)source->left * MValue, Renderer::GetTargetHeight()-(float)source->top * MValue); glVertex2f(-1,-1); + glTexCoord2f((float)source->right * MValue, Renderer::GetTargetHeight()-(float)source->top * MValue); glVertex2f(1,-1); + glTexCoord2f((float)source->right * MValue, Renderer::GetTargetHeight()-(float)source->bottom * MValue); glVertex2f(1,1); glEnd(); GL_REPORT_ERRORD();