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
This commit is contained in:
arcum42 2010-09-06 09:46:33 +00:00
parent dc49a995d6
commit a468a27523
2 changed files with 9 additions and 16 deletions

View File

@ -54,7 +54,7 @@ class GLWindow
void UpdateGrabKey();
#endif
bool fullScreen, doubleBuffered;
s32 x, y;
//s32 x, y;
u32 width, height, depth;
public:

View File

@ -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;
}
}
}