Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
elmindreda committed Mar 28, 2016
1 parent 925208d commit f96d865
Showing 8 changed files with 9 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/egl_context.c
Original file line number Diff line number Diff line change
@@ -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;
}


1 change: 0 additions & 1 deletion src/egl_context.h
Original file line number Diff line number Diff line change
@@ -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

6 changes: 3 additions & 3 deletions src/glx_context.c
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion src/glx_context.h
Original file line number Diff line number Diff line change
@@ -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

4 changes: 1 addition & 3 deletions src/internal.h
Original file line number Diff line number Diff line change
@@ -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;
};


1 change: 0 additions & 1 deletion src/nsgl_context.h
Original file line number Diff line number Diff line change
@@ -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

4 changes: 2 additions & 2 deletions src/wgl_context.c
Original file line number Diff line number Diff line change
@@ -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;
1 change: 0 additions & 1 deletion src/wgl_context.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit f96d865

Please sign in to comment.