From f96d865b93b113543d36edfa5d605f970e53b890 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 28 Mar 2016 20:11:22 +0200 Subject: [PATCH] Cleanup --- src/egl_context.c | 6 +++--- src/egl_context.h | 1 - src/glx_context.c | 6 +++--- src/glx_context.h | 1 - src/internal.h | 4 +--- src/nsgl_context.h | 1 - src/wgl_context.c | 4 ++-- src/wgl_context.h | 1 - 8 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/egl_context.c b/src/egl_context.c index 827ccbfd..74067fc0 100644 --- a/src/egl_context.c +++ b/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; } diff --git a/src/egl_context.h b/src/egl_context.h index 15d5a125..0b0b4dcb 100644 --- a/src/egl_context.h +++ b/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 diff --git a/src/glx_context.c b/src/glx_context.c index 22ec7e10..5fde5b05 100644 --- a/src/glx_context.c +++ b/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 diff --git a/src/glx_context.h b/src/glx_context.h index dc54c797..c60186a6 100644 --- a/src/glx_context.h +++ b/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 diff --git a/src/internal.h b/src/internal.h index ae66c0be..d9d037c6 100644 --- a/src/internal.h +++ b/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; }; diff --git a/src/nsgl_context.h b/src/nsgl_context.h index 6a0a22fd..ab4cf3df 100644 --- a/src/nsgl_context.h +++ b/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 diff --git a/src/wgl_context.c b/src/wgl_context.c index afc85bab..608587c7 100644 --- a/src/wgl_context.c +++ b/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; diff --git a/src/wgl_context.h b/src/wgl_context.h index bc8968b4..cca55e03 100644 --- a/src/wgl_context.h +++ b/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