diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_WindowWin32.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp index 230df02c359..905b2f7ac63 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cpp +++ b/intern/ghost/intern/GHOST_WindowWin32.cpp @@ -871,12 +871,25 @@ static int EnumPixelFormats(HDC hdc) { for(i=1; i<=n; i++) { /* not the idiom, but it's right */ ::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd ); w = WeightPixelFormat(pfd); - if(w > weight) { - weight = w; - iPixelFormat = i; + // be strict on stereo + if (!((sPreferredFormat.dwFlags ^ pfd.dwFlags) & PFD_STEREO)) { + if(w > weight) { + weight = w; + iPixelFormat = i; + } + } + } + if (weight == 0) { + // we could find the correct stereo setting, just find any suitable format + for(i=1; i<=n; i++) { /* not the idiom, but it's right */ + ::DescribePixelFormat( hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd ); + w = WeightPixelFormat(pfd); + if(w > weight) { + weight = w; + iPixelFormat = i; + } } } - return iPixelFormat; } |