From a468a2752382401b32399f60c68023a70b58d3fd Mon Sep 17 00:00:00 2001 From: arcum42 Date: Mon, 6 Sep 2010 09:46:33 +0000 Subject: [PATCH] GregMiscellaneous: zzogl: Got rid x & y in GLWin. Make sure nBackBuffer gets set to the right width and height. git-svn-id: http://pcsx2.googlecode.com/svn/branches/GregMiscellaneous@3735 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/zzogl-pg/opengl/GLWin.h | 2 +- plugins/zzogl-pg/opengl/GLWinX11.cpp | 23 ++++++++--------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/plugins/zzogl-pg/opengl/GLWin.h b/plugins/zzogl-pg/opengl/GLWin.h index 783e48b171..eed9c12063 100644 --- a/plugins/zzogl-pg/opengl/GLWin.h +++ b/plugins/zzogl-pg/opengl/GLWin.h @@ -54,7 +54,7 @@ class GLWindow void UpdateGrabKey(); #endif bool fullScreen, doubleBuffered; - s32 x, y; + //s32 x, y; u32 width, height, depth; public: diff --git a/plugins/zzogl-pg/opengl/GLWinX11.cpp b/plugins/zzogl-pg/opengl/GLWinX11.cpp index a762d4200b..211bcf78c0 100644 --- a/plugins/zzogl-pg/opengl/GLWinX11.cpp +++ b/plugins/zzogl-pg/opengl/GLWinX11.cpp @@ -60,8 +60,6 @@ bool GLWindow::ReleaseContext() void GLWindow::CloseWindow() { - conf.x = x; - conf.y = y; SaveConfig(); if (!glDisplay) return; @@ -128,7 +126,9 @@ void GLWindow::GetWindowSize() s32 yDummy; XGetGeometry(glDisplay, glWindow, &winDummy, &xDummy, &yDummy, &width, &height, &borderDummy, &depth); - ZZLog::Error_Log("Resolution %dx%d. Depth %d bpp. Position (%d,%d)", width, height, depth, x, y); + nBackbufferWidth = width; + nBackbufferHeight = height; + ZZLog::Error_Log("Resolution %dx%d. Depth %d bpp. Position (%d,%d)", width, height, depth, conf.x, conf.y); } void GLWindow::GetGLXVersion() @@ -202,21 +202,14 @@ void GLWindow::ToggleFullscreen() bool GLWindow::DisplayWindow(int _width, int _height) { - Colormap cmap; - - x = conf.x; - y = conf.y; - if (!CreateVisual()) return false; /* create a GLX context */ context = glXCreateContext(glDisplay, vi, NULL, GL_TRUE); /* create a color map */ - cmap = XCreateColormap(glDisplay, RootWindow(glDisplay, vi->screen), + attr.colormap = XCreateColormap(glDisplay, RootWindow(glDisplay, vi->screen), vi->visual, AllocNone); - - attr.colormap = cmap; attr.border_pixel = 0; attr.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask | StructureNotifyMask | SubstructureRedirectMask | SubstructureNotifyMask | @@ -254,7 +247,7 @@ bool GLWindow::DisplayWindow(int _width, int _height) ToggleFullscreen(); } else { // Restore the window position - XMoveWindow(glDisplay, glWindow, x, y); + XMoveWindow(glDisplay, glWindow, conf.x, conf.y); GetWindowSize(); } @@ -298,12 +291,12 @@ void GLWindow::ResizeCheck() } if (!fullScreen) { - if ((event.xconfigure.x != x) || (event.xconfigure.y != y)) + if ((event.xconfigure.x != conf.x) || (event.xconfigure.y != conf.y)) { // Fixme; x&y occassionally gives values near the top left corner rather then the real values, // causing the window to change positions when adjusting ZZOgl's settings. - x = event.xconfigure.x; - y = event.xconfigure.y; + conf.x = event.xconfigure.x; + conf.y = event.xconfigure.y; } } }