Add r_togglecomposition cvar on Windows for Roma Loom.

r_togglecomposition: enable/disable toggle of desktop composition when initializing screen modes

default value: 1

git-svn-id: https://svn.eduke32.com/eduke32@3371 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2013-01-04 23:42:43 +00:00
parent 05a550c08d
commit a4bbf30c3a

View file

@ -5,6 +5,7 @@
#include "build.h" #include "build.h"
#include "baselayer.h" #include "baselayer.h"
#include "osd.h"
#include "winbits.h" #include "winbits.h"
#ifndef DEBUGGINGAIDS #ifndef DEBUGGINGAIDS
@ -34,6 +35,8 @@ static OSVERSIONINFOEX osv;
static HMODULE nedhandle = NULL; static HMODULE nedhandle = NULL;
static int32_t togglecomp = 1;
// //
// CheckWinVersion() -- check to see what version of Windows we happen to be running under // CheckWinVersion() -- check to see what version of Windows we happen to be running under
// //
@ -207,6 +210,21 @@ void win_open(void)
void win_init(void) void win_init(void)
{ {
uint32_t i;
cvar_t cvars_win[] =
{
{ "r_togglecomposition","r_togglecomposition: enable/disable toggle of desktop composition when initializing screen modes",(void *) &togglecomp, CVAR_BOOL, 0, 1 },
};
for (i=0; i<sizeof(cvars_win)/sizeof(cvars_win[0]); i++)
{
if (OSD_RegisterCvar(&cvars_win[i]))
continue;
OSD_RegisterFunction(cvars_win[i].name, cvars_win[i].desc, osdcmd_cvar_set);
}
win_printversion(); win_printversion();
if (nedhandle) if (nedhandle)
@ -215,7 +233,7 @@ void win_init(void)
void win_setvideomode(int32_t c) void win_setvideomode(int32_t c)
{ {
if (osv.dwMajorVersion >= 6 && osv.dwMinorVersion < 2) if (togglecomp && osv.dwMajorVersion == 6 && osv.dwMinorVersion < 2)
ToggleDesktopComposition(c < 16); ToggleDesktopComposition(c < 16);
} }