34 #ifndef GLXBadProfileARB 35 #define GLXBadProfileARB 13 56 int i, nativeCount, usableCount;
63 if (vendor && strcmp(vendor,
"Chromium") == 0)
68 if (!nativeConfigs || !nativeCount)
77 for (i = 0; i < nativeCount; i++)
123 if (
_glfw.glx.ARB_multisample)
126 if (
_glfw.glx.ARB_framebuffer_sRGB ||
_glfw.glx.EXT_framebuffer_sRGB)
137 XFree(nativeConfigs);
140 return closest !=
NULL;
165 "GLX: Failed to make context current");
174 "GLX: Failed to clear current context");
191 if (
_glfw.glx.EXT_swap_control)
197 else if (
_glfw.glx.MESA_swap_control)
198 _glfw.glx.SwapIntervalMESA(interval);
199 else if (
_glfw.glx.SGI_swap_control)
202 _glfw.glx.SwapIntervalSGI(interval);
208 const char* extensions =
221 if (
_glfw.glx.GetProcAddress)
222 return _glfw.glx.GetProcAddress((
const GLubyte*) procname);
223 else if (
_glfw.glx.GetProcAddressARB)
224 return _glfw.glx.GetProcAddressARB((
const GLubyte*) procname);
233 if (window->
context.glx.window)
236 window->
context.glx.window = None;
239 if (window->
context.glx.handle)
256 const char* sonames[] =
258 #if defined(_GLFW_GLX_LIBRARY) 260 #elif defined(__CYGWIN__) 272 for (i = 0; sonames[
i]; i++)
285 _glfw.glx.GetFBConfigs =
287 _glfw.glx.GetFBConfigAttrib =
289 _glfw.glx.GetClientString =
291 _glfw.glx.QueryExtension =
293 _glfw.glx.QueryVersion =
295 _glfw.glx.DestroyContext =
297 _glfw.glx.MakeCurrent =
299 _glfw.glx.SwapBuffers =
301 _glfw.glx.QueryExtensionsString =
303 _glfw.glx.CreateNewContext =
305 _glfw.glx.CreateWindow =
307 _glfw.glx.DestroyWindow =
309 _glfw.glx.GetProcAddress =
311 _glfw.glx.GetProcAddressARB =
313 _glfw.glx.GetVisualFromFBConfig =
316 if (!
_glfw.glx.GetFBConfigs ||
317 !
_glfw.glx.GetFBConfigAttrib ||
318 !
_glfw.glx.GetClientString ||
319 !
_glfw.glx.QueryExtension ||
320 !
_glfw.glx.QueryVersion ||
321 !
_glfw.glx.DestroyContext ||
322 !
_glfw.glx.MakeCurrent ||
323 !
_glfw.glx.SwapBuffers ||
324 !
_glfw.glx.QueryExtensionsString ||
325 !
_glfw.glx.CreateNewContext ||
326 !
_glfw.glx.CreateWindow ||
327 !
_glfw.glx.DestroyWindow ||
328 !
_glfw.glx.GetProcAddress ||
329 !
_glfw.glx.GetProcAddressARB ||
330 !
_glfw.glx.GetVisualFromFBConfig)
333 "GLX: Failed to load required entry points");
338 &
_glfw.glx.errorBase,
339 &
_glfw.glx.eventBase))
348 "GLX: Failed to query GLX version");
352 if (
_glfw.glx.major == 1 &&
_glfw.glx.minor < 3)
355 "GLX: GLX version 1.3 is required");
364 if (
_glfw.glx.SwapIntervalEXT)
373 if (
_glfw.glx.SwapIntervalSGI)
382 if (
_glfw.glx.SwapIntervalMESA)
400 if (
_glfw.glx.CreateContextAttribsARB)
436 #define setAttrib(a, v) \ 438 assert((size_t) (index + 1) < sizeof(attribs) / sizeof(attribs[0])); \ 439 attribs[index++] = a; \ 440 attribs[index++] = v; \ 453 if (ctxconfig->
share)
459 "GLX: Failed to find a suitable GLXFBConfig");
465 if (!
_glfw.glx.ARB_create_context ||
466 !
_glfw.glx.ARB_create_context_profile ||
467 !
_glfw.glx.EXT_create_context_es2_profile)
470 "GLX: OpenGL ES requested but GLX_EXT_create_context_es2_profile is unavailable");
477 if (!
_glfw.glx.ARB_create_context)
480 "GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable");
487 if (!
_glfw.glx.ARB_create_context ||
488 !
_glfw.glx.ARB_create_context_profile)
491 "GLX: An OpenGL profile requested but GLX_ARB_create_context_profile is unavailable");
498 if (
_glfw.glx.ARB_create_context)
515 if (ctxconfig->
debug)
520 if (
_glfw.glx.ARB_create_context_robustness)
539 if (
_glfw.glx.ARB_context_flush_control)
556 if (
_glfw.glx.ARB_create_context_no_error)
563 if (ctxconfig->
major != 1 || ctxconfig->
minor != 0)
578 _glfw.glx.CreateContextAttribsARB(
_glfw.x11.display,
588 if (!window->
context.glx.handle)
608 if (!window->
context.glx.handle)
616 if (!window->
context.glx.window)
639 Visual** visual,
int*
depth)
647 "GLX: Failed to find a suitable GLXFBConfig");
655 "GLX: Failed to retrieve Visual for GLXFBConfig");
659 *visual = result->visual;
660 *depth = result->depth;
682 return window->
context.glx.handle;
696 return window->
context.glx.window;
#define GLX_CONTEXT_MINOR_VERSION_ARB
#define glXGetFBConfigAttrib
_GLFWswapbuffersfun swapBuffers
#define GLX_DRAWABLE_TYPE
#define GLX_NO_RESET_NOTIFICATION_ARB
#define GLFW_OPENGL_ES_API
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
_GLFWgetprocaddressfun getProcAddress
#define GLFW_OPENGL_COMPAT_PROFILE
GLFWbool _glfwChooseVisualGLX(const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig, Visual **visual, int *depth)
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
#define glXQueryExtensionsString
#define GLX_CONTEXT_DEBUG_BIT_ARB
GLuint64 GLenum void * handle
static int getGLXFBConfigAttrib(GLXFBConfig fbconfig, int attrib)
_GLFWdestroycontextfun destroy
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow *handle)
GLXContext(* PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display *, GLXFBConfig, GLXContext, Bool, const int *)
#define glXGetVisualFromFBConfig
GLint GLint GLsizei GLsizei GLsizei depth
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
GLFWbool _glfwInitGLX(void)
#define glXGetClientString
#define GLFW_LOSE_CONTEXT_ON_RESET
static void destroyContextGLX(_GLFWwindow *window)
#define GLFW_OPENGL_ANY_PROFILE
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
int(* PFNGLXSWAPINTERVALSGIPROC)(int)
#define GLFW_RELEASE_BEHAVIOR_NONE
struct __GLXcontext * GLXContext
void _glfwGrabErrorHandlerX11(void)
#define GLX_ACCUM_ALPHA_SIZE
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
#define GLX_CONTEXT_FLAGS_ARB
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
void _glfwInputErrorX11(int error, const char *message)
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB
#define GLX_CONTEXT_PROFILE_MASK_ARB
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
_W64 unsigned int uintptr_t
#define GLX_ACCUM_RED_SIZE
_GLFWmakecontextcurrentfun makeCurrent
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
static int extensionSupportedGLX(const char *extension)
#define GLX_ACCUM_BLUE_SIZE
static void swapBuffersGLX(_GLFWwindow *window)
void _glfwInputError(int code, const char *format,...)
static void swapIntervalGLX(int interval)
_GLFWextensionsupportedfun extensionSupported
static void makeContextCurrentGLX(_GLFWwindow *window)
#define GLFW_RELEASE_BEHAVIOR_FLUSH
GLFWbool _glfwCreateContextGLX(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
_GLFWswapintervalfun swapInterval
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow *handle)
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
void _glfwTerminateGLX(void)
static GLXContext createLegacyContextGLX(_GLFWwindow *window, GLXFBConfig fbconfig, GLXContext share)
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
void _glfwReleaseErrorHandlerX11(void)
#define GLFW_OPENGL_CORE_PROFILE
int(* PFNGLXSWAPINTERVALMESAPROC)(int)
#define glXDestroyContext
#define GLX_CONTEXT_MAJOR_VERSION_ARB
void * _glfwPlatformGetTls(_GLFWtls *tls)
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT
struct __GLXFBConfig * GLXFBConfig
static GLFWglproc getProcAddressGLX(const char *procname)
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB
#define glXQueryExtension
#define GLX_ACCUM_GREEN_SIZE
#define glXCreateNewContext
static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig *desired, GLXFBConfig *result)
void(* PFNGLXSWAPINTERVALEXTPROC)(Display *, GLXDrawable, int)
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB
#define GLFW_NO_RESET_NOTIFICATION
struct GLFWwindow GLFWwindow
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
#define GLX_LOSE_CONTEXT_ON_RESET_ARB