mirror of https://github.com/PCSX2/pcsx2.git
zzogl-pg: A quick persistant window hack.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2924 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
d2c63c7bbc
commit
5c20358c19
|
@ -60,6 +60,9 @@ bool GLWindow::ReleaseWindow()
|
||||||
|
|
||||||
void GLWindow::CloseWindow()
|
void GLWindow::CloseWindow()
|
||||||
{
|
{
|
||||||
|
conf.x = x;
|
||||||
|
conf.y = y;
|
||||||
|
SaveConfig();
|
||||||
if ( glDisplay != NULL )
|
if ( glDisplay != NULL )
|
||||||
{
|
{
|
||||||
XCloseDisplay(glDisplay);
|
XCloseDisplay(glDisplay);
|
||||||
|
@ -79,6 +82,9 @@ bool GLWindow::DisplayWindow(int _width, int _height)
|
||||||
Window winDummy;
|
Window winDummy;
|
||||||
unsigned int borderDummy;
|
unsigned int borderDummy;
|
||||||
|
|
||||||
|
x = conf.x;
|
||||||
|
y = conf.y;
|
||||||
|
|
||||||
// attributes for a single buffered visual in RGBA format with at least
|
// attributes for a single buffered visual in RGBA format with at least
|
||||||
// 8 bits per color and a 24 bit depth buffer
|
// 8 bits per color and a 24 bit depth buffer
|
||||||
int attrListSgl[] = {GLX_RGBA, GLX_RED_SIZE, 8,
|
int attrListSgl[] = {GLX_RGBA, GLX_RED_SIZE, 8,
|
||||||
|
@ -200,6 +206,7 @@ bool GLWindow::DisplayWindow(int _width, int _height)
|
||||||
XSetWMProtocols(glDisplay, glWindow, &wmDelete, 1);
|
XSetWMProtocols(glDisplay, glWindow, &wmDelete, 1);
|
||||||
XSetStandardProperties(glDisplay, glWindow, "ZZOgl-PG", "ZZOgl-PG", None, NULL, 0, NULL);
|
XSetStandardProperties(glDisplay, glWindow, "ZZOgl-PG", "ZZOgl-PG", None, NULL, 0, NULL);
|
||||||
XMapRaised(glDisplay, glWindow);
|
XMapRaised(glDisplay, glWindow);
|
||||||
|
XMoveWindow(glDisplay, glWindow, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// connect the glx-context to the window
|
// connect the glx-context to the window
|
||||||
|
@ -240,11 +247,17 @@ void GLWindow::ResizeCheck()
|
||||||
|
|
||||||
while(XCheckTypedEvent(glDisplay, ConfigureNotify, &event))
|
while(XCheckTypedEvent(glDisplay, ConfigureNotify, &event))
|
||||||
{
|
{
|
||||||
if ((event.xconfigure.width != width) || (event.xconfigure.height != height)) {
|
if ((event.xconfigure.width != width) || (event.xconfigure.height != height))
|
||||||
|
{
|
||||||
ZeroGS::ChangeWindowSize(event.xconfigure.width, event.xconfigure.height);
|
ZeroGS::ChangeWindowSize(event.xconfigure.width, event.xconfigure.height);
|
||||||
width = event.xconfigure.width;
|
width = event.xconfigure.width;
|
||||||
height = event.xconfigure.height;
|
height = event.xconfigure.height;
|
||||||
}
|
}
|
||||||
|
if ((event.xconfigure.x != x) || (event.xconfigure.y != y))
|
||||||
|
{
|
||||||
|
x = event.xconfigure.x;
|
||||||
|
y = event.xconfigure.y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,8 @@ void SaveConfig()
|
||||||
fprintf(f, "gamesettings = %x\n", conf.gamesettings); //u32
|
fprintf(f, "gamesettings = %x\n", conf.gamesettings); //u32
|
||||||
fprintf(f, "width = %x\n", conf.width); //u32
|
fprintf(f, "width = %x\n", conf.width); //u32
|
||||||
fprintf(f, "height = %x\n", conf.height); //u32
|
fprintf(f, "height = %x\n", conf.height); //u32
|
||||||
|
fprintf(f, "x = %x\n", conf.x); //u32
|
||||||
|
fprintf(f, "y = %x\n", conf.y); //u32
|
||||||
fprintf(f, "log = %x\n", conf.log); //u32
|
fprintf(f, "log = %x\n", conf.log); //u32
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
@ -57,6 +59,8 @@ void LoadConfig()
|
||||||
conf.bilinear = 1;
|
conf.bilinear = 1;
|
||||||
conf.width = 640;
|
conf.width = 640;
|
||||||
conf.height = 480;
|
conf.height = 480;
|
||||||
|
conf.x = 0;
|
||||||
|
conf.y = 0;
|
||||||
conf.aa = 0;
|
conf.aa = 0;
|
||||||
conf.log = 1;
|
conf.log = 1;
|
||||||
|
|
||||||
|
@ -76,6 +80,8 @@ void LoadConfig()
|
||||||
err = fscanf(f, "gamesettings = %x\n", &conf.gamesettings);//u32
|
err = fscanf(f, "gamesettings = %x\n", &conf.gamesettings);//u32
|
||||||
err = fscanf(f, "width = %x\n", &conf.width);//u32
|
err = fscanf(f, "width = %x\n", &conf.width);//u32
|
||||||
err = fscanf(f, "height = %x\n", &conf.height);//u32
|
err = fscanf(f, "height = %x\n", &conf.height);//u32
|
||||||
|
err = fscanf(f, "x = %x\n", &conf.x);//u32
|
||||||
|
err = fscanf(f, "y = %x\n", &conf.y);//u32
|
||||||
err = fscanf(f, "log = %x\n", &conf.log);//u32
|
err = fscanf(f, "log = %x\n", &conf.log);//u32
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
|
@ -112,5 +118,10 @@ void LoadConfig()
|
||||||
conf.width = 640;
|
conf.width = 640;
|
||||||
conf.height = 480;
|
conf.height = 480;
|
||||||
}
|
}
|
||||||
|
if( conf.x <= 0 || conf.y <= 0 )
|
||||||
|
{
|
||||||
|
conf.x = 0;
|
||||||
|
conf.y = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -160,6 +160,7 @@ typedef struct
|
||||||
u32 options; // game options -- different hacks.
|
u32 options; // game options -- different hacks.
|
||||||
u32 gamesettings;// default game settings
|
u32 gamesettings;// default game settings
|
||||||
int width, height; // View target size, has no impact towards speed
|
int width, height; // View target size, has no impact towards speed
|
||||||
|
int x, y; // Lets try for a persistant window position.
|
||||||
bool isWideScreen; // Widescreen support
|
bool isWideScreen; // Widescreen support
|
||||||
u32 log;
|
u32 log;
|
||||||
} GSconf;
|
} GSconf;
|
||||||
|
|
|
@ -194,7 +194,6 @@ ZeroGS::Create_Window(int _width, int _height) {
|
||||||
nBackbufferHeight = _height;
|
nBackbufferHeight = _height;
|
||||||
fiRendWidth = 1.0f / nBackbufferWidth;
|
fiRendWidth = 1.0f / nBackbufferWidth;
|
||||||
fiRendHeight = 1.0f / nBackbufferHeight;
|
fiRendHeight = 1.0f / nBackbufferHeight;
|
||||||
|
|
||||||
if (!GLWin.DisplayWindow(_width, _height)) return false;
|
if (!GLWin.DisplayWindow(_width, _height)) return false;
|
||||||
|
|
||||||
s_nFullscreen = (conf.options & GSOPTION_FULLSCREEN) ? 1 : 0;
|
s_nFullscreen = (conf.options & GSOPTION_FULLSCREEN) ? 1 : 0;
|
||||||
|
|
Loading…
Reference in New Issue