mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-22 11:51:22 +00:00
Turn off desktop compositing in Windows ("Aero") for Radiant.
Otherwise, "hall of mirrors" effect takes place in the OpenGL viewports. This fix is a real hack. It's actually borrowed from other Radiants such as NetRadiant. I'd like to fix the underlying issue someday so that Aero can be used with Radiant. git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@433 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
083f7c7d6a
commit
1f11459c84
1 changed files with 27 additions and 0 deletions
|
@ -429,6 +429,33 @@ int main( int argc, char* argv[] ) {
|
|||
char *libgl, *ptr;
|
||||
int i, j, k;
|
||||
|
||||
/*
|
||||
Rambetter on Fri Jan 21, 2011:
|
||||
|
||||
People with recent NVIDIA cards and Windows 7 (Aero) are complaining about "hall of mirrors"
|
||||
effect in the OpenGL viewports. The code below is borrowed from NetRadiant to address
|
||||
this issue. This change turns off desktop compositing (globally) while Radiant is running.
|
||||
It's a real hack but the "correct" fix is very involving, so until the underlying problem
|
||||
is addressed we need this code here. I don't know for sure what the underlying problem is,
|
||||
but I have a hunch it's the version of gtkglext.dll we're using.
|
||||
*/
|
||||
|
||||
#ifdef _WIN32
|
||||
HMODULE lib;
|
||||
lib = LoadLibrary("dwmapi.dll");
|
||||
if (lib != 0)
|
||||
{
|
||||
void (WINAPI *qDwmEnableComposition) (bool bEnable) =
|
||||
(void (WINAPI *) (bool bEnable)) GetProcAddress(lib, "DwmEnableComposition");
|
||||
if (qDwmEnableComposition)
|
||||
{
|
||||
qDwmEnableComposition(FALSE);
|
||||
}
|
||||
FreeLibrary(lib);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
Rambetter on Sat Nov 13, 2010:
|
||||
|
||||
|
|
Loading…
Reference in a new issue