Explorar o código

Add tracking of single-/double-buffering

This adds the state part of 04f21abb52e557addb932af1634b29658fd3a6ae
(Make GLFW_DOUBLEBUFFER a window attribute), but without the associated
API change, because this is needed by later bug fixes that will go into
the stable branch.
Camilla Löwy %!s(int64=4) %!d(string=hai) anos
pai
achega
508e24c01c
Modificáronse 2 ficheiros con 3 adicións e 0 borrados
  1. 1 0
      src/internal.h
  2. 2 0
      src/window.c

+ 1 - 0
src/internal.h

@@ -375,6 +375,7 @@ struct _GLFWwindow
     GLFWbool            focusOnShow;
     GLFWbool            focusOnShow;
     GLFWbool            shouldClose;
     GLFWbool            shouldClose;
     void*               userPointer;
     void*               userPointer;
+    GLFWbool            doublebuffer;
     GLFWvidmode         videoMode;
     GLFWvidmode         videoMode;
     _GLFWmonitor*       monitor;
     _GLFWmonitor*       monitor;
     _GLFWcursor*        cursor;
     _GLFWcursor*        cursor;

+ 2 - 0
src/window.c

@@ -205,6 +205,8 @@ GLFWAPI GLFWwindow* glfwCreateWindow(int width, int height,
     window->focusOnShow = wndconfig.focusOnShow;
     window->focusOnShow = wndconfig.focusOnShow;
     window->cursorMode  = GLFW_CURSOR_NORMAL;
     window->cursorMode  = GLFW_CURSOR_NORMAL;
 
 
+    window->doublebuffer = fbconfig.doublebuffer;
+
     window->minwidth    = GLFW_DONT_CARE;
     window->minwidth    = GLFW_DONT_CARE;
     window->minheight   = GLFW_DONT_CARE;
     window->minheight   = GLFW_DONT_CARE;
     window->maxwidth    = GLFW_DONT_CARE;
     window->maxwidth    = GLFW_DONT_CARE;