mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Better alt-tab support for fullscreen OpenGL on win32
git-svn-id: https://svn.eduke32.com/eduke32@391 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
f8e113ce03
commit
e11f4c9afb
3 changed files with 29 additions and 9 deletions
|
@ -114,7 +114,7 @@ char videomodereset = 0;
|
|||
|
||||
// input and events
|
||||
char inputdevices=0;
|
||||
char quitevent=0, appactive=1;
|
||||
char quitevent=0, appactive=1, realfs=0;
|
||||
long mousex=0, mousey=0, mouseb=0;
|
||||
static unsigned long mousewheel[2] = { 0,0 };
|
||||
#define MouseWheelFakePressTime (25) // getticks() is a 1000Hz timer, and the button press is faked for 100ms
|
||||
|
@ -3504,12 +3504,32 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
|
|||
break;
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
{
|
||||
appactive = wParam;
|
||||
#if defined(POLYMOST) && defined(USE_OPENGL)
|
||||
if (hGLWindow)
|
||||
{
|
||||
if (!appactive && fullscreen)
|
||||
{
|
||||
realfs = fullscreen;
|
||||
setvideomode(xdim,ydim,bpp,!fullscreen);
|
||||
ShowWindow(hWindow, SW_MINIMIZE);
|
||||
}
|
||||
else if (appactive && realfs)
|
||||
{
|
||||
ShowWindow(hWindow, SW_SHOWNORMAL);
|
||||
SetForegroundWindow(hWindow);
|
||||
SetFocus(hWindow);
|
||||
setvideomode(xdim,ydim,bpp,realfs);
|
||||
realfs = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (backgroundidle)
|
||||
SetPriorityClass( GetCurrentProcess(),
|
||||
appactive ? NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS );
|
||||
break;
|
||||
|
||||
}
|
||||
case WM_ACTIVATE:
|
||||
if (desktopbpp <= 8) {
|
||||
if (appactive) {
|
||||
|
|
|
@ -235,13 +235,6 @@ void playanm(char *fn,char t)
|
|||
palptr = ANIM_GetPalette();
|
||||
for (i=0;i<256;i++)
|
||||
{
|
||||
/*
|
||||
j = (i<<2); k = j-i;
|
||||
tempbuf[j+0] = (palptr[k+2]>>2);
|
||||
tempbuf[j+1] = (palptr[k+1]>>2);
|
||||
tempbuf[j+2] = (palptr[k+0]>>2);
|
||||
tempbuf[j+3] = 0;
|
||||
*/
|
||||
j = i*3;
|
||||
animpal[j+0] = (palptr[j+0]>>2);
|
||||
animpal[j+1] = (palptr[j+1]>>2);
|
||||
|
@ -264,7 +257,10 @@ void playanm(char *fn,char t)
|
|||
handleevents();
|
||||
getpackets();
|
||||
if (restorepalette == 1)
|
||||
{
|
||||
setgamepalette(&ps[myconnectindex],animpal,2);
|
||||
restorepalette = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (t == 10) ototalclock += 14;
|
||||
|
|
|
@ -9603,6 +9603,10 @@ void app_main(int argc,char **argv)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef RENDERTYPEWIN
|
||||
backgroundidle = 0;
|
||||
#endif
|
||||
|
||||
OSD_SetLogFile("eduke32.log");
|
||||
|
||||
wm_setapptitle(HEAD2);
|
||||
|
|
Loading…
Reference in a new issue