Camilla Berglund 9 anos atrás
pai
commit
f96d865b93
8 arquivos alterados com 9 adições e 15 exclusões
  1. 3 3
      src/egl_context.c
  2. 0 1
      src/egl_context.h
  3. 3 3
      src/glx_context.c
  4. 0 1
      src/glx_context.h
  5. 1 3
      src/internal.h
  6. 0 1
      src/nsgl_context.h
  7. 2 2
      src/wgl_context.c
  8. 0 1
      src/wgl_context.h

+ 3 - 3
src/egl_context.c

@@ -155,18 +155,18 @@ static GLFWbool chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
         u->samples = getConfigAttrib(n, EGL_SAMPLES);
         u->doublebuffer = GLFW_TRUE;
 
-        u->egl = n;
+        u->handle = (uintptr_t) n;
         usableCount++;
     }
 
     closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
     if (closest)
-        *result = closest->egl;
+        *result = (EGLConfig) closest->handle;
 
     free(nativeConfigs);
     free(usableConfigs);
 
-    return closest ? GLFW_TRUE : GLFW_FALSE;
+    return closest != NULL;
 }
 
 

+ 0 - 1
src/egl_context.h

@@ -149,7 +149,6 @@ typedef GLFWglproc (EGLAPIENTRY * PFNEGLGETPROCADDRESSPROC)(const char*);
 #define eglQueryString _glfw.egl.QueryString
 #define eglGetProcAddress _glfw.egl.GetProcAddress
 
-#define _GLFW_PLATFORM_FBCONFIG                 EGLConfig       egl
 #define _GLFW_PLATFORM_CONTEXT_STATE            _GLFWcontextEGL egl
 #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE    _GLFWlibraryEGL egl
 

+ 3 - 3
src/glx_context.c

@@ -115,18 +115,18 @@ static GLFWbool chooseFBConfig(const _GLFWfbconfig* desired, GLXFBConfig* result
         if (_glfw.glx.ARB_framebuffer_sRGB || _glfw.glx.EXT_framebuffer_sRGB)
             u->sRGB = getFBConfigAttrib(n, GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB);
 
-        u->glx = n;
+        u->handle = (uintptr_t) n;
         usableCount++;
     }
 
     closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
     if (closest)
-        *result = closest->glx;
+        *result = (GLXFBConfig) closest->handle;
 
     XFree(nativeConfigs);
     free(usableConfigs);
 
-    return closest ? GLFW_TRUE : GLFW_FALSE;
+    return closest != NULL;
 }
 
 // Create the OpenGL context using legacy API

+ 0 - 1
src/glx_context.h

@@ -108,7 +108,6 @@ typedef void (*PFNGLXDESTROYWINDOWPROC)(Display*,GLXWindow);
 #define glXCreateWindow _glfw.glx.CreateWindow
 #define glXDestroyWindow _glfw.glx.DestroyWindow
 
-#define _GLFW_PLATFORM_FBCONFIG                 GLXFBConfig     glx
 #define _GLFW_PLATFORM_CONTEXT_STATE            _GLFWcontextGLX glx
 #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE    _GLFWlibraryGLX glx
 

+ 1 - 3
src/internal.h

@@ -296,9 +296,7 @@ struct _GLFWfbconfig
     int         samples;
     GLFWbool    sRGB;
     GLFWbool    doublebuffer;
-
-    // This is defined in the context API's context.h
-    _GLFW_PLATFORM_FBCONFIG;
+    uintptr_t   handle;
 };
 
 

+ 0 - 1
src/nsgl_context.h

@@ -27,7 +27,6 @@
 #ifndef _glfw3_nsgl_context_h_
 #define _glfw3_nsgl_context_h_
 
-#define _GLFW_PLATFORM_FBCONFIG
 #define _GLFW_PLATFORM_CONTEXT_STATE            _GLFWcontextNSGL nsgl
 #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE    _GLFWlibraryNSGL nsgl
 

+ 2 - 2
src/wgl_context.c

@@ -236,7 +236,7 @@ static GLFWbool choosePixelFormat(_GLFWwindow* window,
                 u->doublebuffer = GLFW_TRUE;
         }
 
-        u->wgl = n;
+        u->handle = n;
         usableCount++;
     }
 
@@ -259,7 +259,7 @@ static GLFWbool choosePixelFormat(_GLFWwindow* window,
         return GLFW_FALSE;
     }
 
-    *result = closest->wgl;
+    *result = (int) closest->handle;
     free(usableConfigs);
 
     return GLFW_TRUE;

+ 0 - 1
src/wgl_context.h

@@ -96,7 +96,6 @@ typedef BOOL (WINAPI * WGLSHARELISTS_T)(HGLRC,HGLRC);
 #define _GLFW_RECREATION_REQUIRED   1
 #define _GLFW_RECREATION_IMPOSSIBLE 2
 
-#define _GLFW_PLATFORM_FBCONFIG                 int             wgl
 #define _GLFW_PLATFORM_CONTEXT_STATE            _GLFWcontextWGL wgl
 #define _GLFW_PLATFORM_LIBRARY_CONTEXT_STATE    _GLFWlibraryWGL wgl