浏览代码

Fixed WGL not re-creating for sRGB hint.

Fixes #312.
Doug Binks 11 年之前
父节点
当前提交
55b5ca0bcc
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 1 0
      README.md
  2. 12 0
      src/wgl_context.c

+ 1 - 0
README.md

@@ -87,6 +87,7 @@ GLFW bundles a number of dependencies in the `deps/` directory.
  - [Win32] Bugfix: Some keys were reported based on the current layout instead
  - [Win32] Bugfix: Some keys were reported based on the current layout instead
                    of their physical location
                    of their physical location
  - [Win32] Bugfix: Maximized hidden windows were restored by `glfwShowWindow`
  - [Win32] Bugfix: Maximized hidden windows were restored by `glfwShowWindow`
+ - [Win32] Bugfix: Context re-creation was not triggered by sRGB hint
  - [X11] Added run-time support for systems lacking the XKB extension
  - [X11] Added run-time support for systems lacking the XKB extension
  - [X11] Made GLX 1.3 the minimum supported version
  - [X11] Made GLX 1.3 the minimum supported version
  - [X11] Bugfix: The case of finding no usable CRTCs was not detected
  - [X11] Bugfix: The case of finding no usable CRTCs was not detected

+ 12 - 0
src/wgl_context.c

@@ -571,6 +571,18 @@ int _glfwAnalyzeContext(const _GLFWwindow* window,
         }
         }
     }
     }
 
 
+    if (fbconfig->sRGB)
+    {
+        // We want sRGB, but can we get it?
+        // sRGB is not a hard constraint, so otherwise we just don't care
+
+        if (window->wgl.ARB_framebuffer_sRGB && window->wgl.ARB_pixel_format)
+        {
+            // We appear to have both the extension and the means to ask for it
+            required = GL_TRUE;
+        }
+    }
+
     if (required)
     if (required)
         return _GLFW_RECREATION_REQUIRED;
         return _GLFW_RECREATION_REQUIRED;