DXGL r381 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r380‎ | r381 | r382 >
Date:01:05, 8 June 2013
Author:admin
Status:new
Tags:
Comment:
Create temporary window within DXGLCFG dialog to detect OpenGL features. Fixes broken titlebars when using WindowBlinds on a DWM enabled version of Windows, and black background under Wine.
Modified paths:
  • /dxglcfg/dxglcfg.cpp (modified) (history)

Diff [purge]

Index: dxglcfg/dxglcfg.cpp
@@ -340,6 +340,7 @@
341341 COLORREF OldTextColor,OldBackColor;
342342 HANDLE token = NULL;
343343 TOKEN_ELEVATION elevation;
 344+ HWND hGLWnd;
344345 switch(Msg)
345346 {
346347 case WM_INITDIALOG:
@@ -361,7 +362,8 @@
362363 // create temporary gl context to get AA and AF settings.
363364 EnumDisplaySettings(NULL,ENUM_CURRENT_SETTINGS,&mode);
364365 pfd.cColorBits = (BYTE)mode.dmBitsPerPel;
365 - dc = GetDC(hWnd);
 366+ hGLWnd = CreateWindow(_T("STATIC"),NULL,WS_CHILD,0,0,16,16,hWnd,NULL,NULL,NULL);
 367+ dc = GetDC(hGLWnd);
366368 pf = ChoosePixelFormat(dc,&pfd);
367369 SetPixelFormat(dc,pf,&pfd);
368370 rc = wglCreateContext(dc);
@@ -386,7 +388,8 @@
387389 }
388390 wglMakeCurrent(dc,NULL);
389391 wglDeleteContext(rc);
390 - ReleaseDC(hWnd,dc);
 392+ ReleaseDC(hGLWnd,dc);
 393+ DestroyWindow(hGLWnd);
391394 // Load global settings.
392395 // scaler
393396 _tcscpy(buffer,_T("Change desktop resolution"));