glx_context.c
Go to the documentation of this file.
1 //========================================================================
2 // GLFW 3.3 GLX - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2002-2006 Marcus Geelnard
5 // Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
6 //
7 // This software is provided 'as-is', without any express or implied
8 // warranty. In no event will the authors be held liable for any damages
9 // arising from the use of this software.
10 //
11 // Permission is granted to anyone to use this software for any purpose,
12 // including commercial applications, and to alter it and redistribute it
13 // freely, subject to the following restrictions:
14 //
15 // 1. The origin of this software must not be misrepresented; you must not
16 // claim that you wrote the original software. If you use this software
17 // in a product, an acknowledgment in the product documentation would
18 // be appreciated but is not required.
19 //
20 // 2. Altered source versions must be plainly marked as such, and must not
21 // be misrepresented as being the original software.
22 //
23 // 3. This notice may not be removed or altered from any source
24 // distribution.
25 //
26 //========================================================================
27 
28 #include "internal.h"
29 
30 #include <string.h>
31 #include <stdlib.h>
32 #include <assert.h>
33 
34 #ifndef GLXBadProfileARB
35  #define GLXBadProfileARB 13
36 #endif
37 
38 
39 // Returns the specified attribute of the specified GLXFBConfig
40 //
41 static int getGLXFBConfigAttrib(GLXFBConfig fbconfig, int attrib)
42 {
43  int value;
44  glXGetFBConfigAttrib(_glfw.x11.display, fbconfig, attrib, &value);
45  return value;
46 }
47 
48 // Return the GLXFBConfig most closely matching the specified hints
49 //
52 {
53  GLXFBConfig* nativeConfigs;
54  _GLFWfbconfig* usableConfigs;
55  const _GLFWfbconfig* closest;
56  int i, nativeCount, usableCount;
57  const char* vendor;
58  GLFWbool trustWindowBit = GLFW_TRUE;
59 
60  // HACK: This is a (hopefully temporary) workaround for Chromium
61  // (VirtualBox GL) not setting the window bit on any GLXFBConfigs
62  vendor = glXGetClientString(_glfw.x11.display, GLX_VENDOR);
63  if (vendor && strcmp(vendor, "Chromium") == 0)
64  trustWindowBit = GLFW_FALSE;
65 
66  nativeConfigs =
67  glXGetFBConfigs(_glfw.x11.display, _glfw.x11.screen, &nativeCount);
68  if (!nativeConfigs || !nativeCount)
69  {
70  _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: No GLXFBConfigs returned");
71  return GLFW_FALSE;
72  }
73 
74  usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
75  usableCount = 0;
76 
77  for (i = 0; i < nativeCount; i++)
78  {
79  const GLXFBConfig n = nativeConfigs[i];
80  _GLFWfbconfig* u = usableConfigs + usableCount;
81 
82  // Only consider RGBA GLXFBConfigs
84  continue;
85 
86  // Only consider window GLXFBConfigs
88  {
89  if (trustWindowBit)
90  continue;
91  }
92 
93  if (desired->transparent)
94  {
95  XVisualInfo* vi = glXGetVisualFromFBConfig(_glfw.x11.display, n);
96  if (vi)
97  {
99  XFree(vi);
100  }
101  }
102 
106 
110 
115 
117 
119  u->stereo = GLFW_TRUE;
121  u->doublebuffer = GLFW_TRUE;
122 
123  if (_glfw.glx.ARB_multisample)
125 
126  if (_glfw.glx.ARB_framebuffer_sRGB || _glfw.glx.EXT_framebuffer_sRGB)
128 
129  u->handle = (uintptr_t) n;
130  usableCount++;
131  }
132 
133  closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
134  if (closest)
135  *result = (GLXFBConfig) closest->handle;
136 
137  XFree(nativeConfigs);
138  free(usableConfigs);
139 
140  return closest != NULL;
141 }
142 
143 // Create the OpenGL context using legacy API
144 //
146  GLXFBConfig fbconfig,
147  GLXContext share)
148 {
149  return glXCreateNewContext(_glfw.x11.display,
150  fbconfig,
152  share,
153  True);
154 }
155 
157 {
158  if (window)
159  {
160  if (!glXMakeCurrent(_glfw.x11.display,
161  window->context.glx.window,
162  window->context.glx.handle))
163  {
165  "GLX: Failed to make context current");
166  return;
167  }
168  }
169  else
170  {
171  if (!glXMakeCurrent(_glfw.x11.display, None, NULL))
172  {
174  "GLX: Failed to clear current context");
175  return;
176  }
177  }
178 
180 }
181 
183 {
184  glXSwapBuffers(_glfw.x11.display, window->context.glx.window);
185 }
186 
187 static void swapIntervalGLX(int interval)
188 {
190 
191  if (_glfw.glx.EXT_swap_control)
192  {
193  _glfw.glx.SwapIntervalEXT(_glfw.x11.display,
194  window->context.glx.window,
195  interval);
196  }
197  else if (_glfw.glx.MESA_swap_control)
198  _glfw.glx.SwapIntervalMESA(interval);
199  else if (_glfw.glx.SGI_swap_control)
200  {
201  if (interval > 0)
202  _glfw.glx.SwapIntervalSGI(interval);
203  }
204 }
205 
206 static int extensionSupportedGLX(const char* extension)
207 {
208  const char* extensions =
209  glXQueryExtensionsString(_glfw.x11.display, _glfw.x11.screen);
210  if (extensions)
211  {
212  if (_glfwStringInExtensionString(extension, extensions))
213  return GLFW_TRUE;
214  }
215 
216  return GLFW_FALSE;
217 }
218 
219 static GLFWglproc getProcAddressGLX(const char* procname)
220 {
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);
225  else
226  return _glfw_dlsym(_glfw.glx.handle, procname);
227 }
228 
229 // Destroy the OpenGL context
230 //
232 {
233  if (window->context.glx.window)
234  {
235  glXDestroyWindow(_glfw.x11.display, window->context.glx.window);
236  window->context.glx.window = None;
237  }
238 
239  if (window->context.glx.handle)
240  {
241  glXDestroyContext(_glfw.x11.display, window->context.glx.handle);
242  window->context.glx.handle = NULL;
243  }
244 }
245 
246 
250 
251 // Initialize GLX
252 //
254 {
255  int i;
256  const char* sonames[] =
257  {
258 #if defined(_GLFW_GLX_LIBRARY)
259  _GLFW_GLX_LIBRARY,
260 #elif defined(__CYGWIN__)
261  "libGL-1.so",
262 #else
263  "libGL.so.1",
264  "libGL.so",
265 #endif
266  NULL
267  };
268 
269  if (_glfw.glx.handle)
270  return GLFW_TRUE;
271 
272  for (i = 0; sonames[i]; i++)
273  {
274  _glfw.glx.handle = _glfw_dlopen(sonames[i]);
275  if (_glfw.glx.handle)
276  break;
277  }
278 
279  if (!_glfw.glx.handle)
280  {
281  _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: Failed to load GLX");
282  return GLFW_FALSE;
283  }
284 
285  _glfw.glx.GetFBConfigs =
286  _glfw_dlsym(_glfw.glx.handle, "glXGetFBConfigs");
287  _glfw.glx.GetFBConfigAttrib =
288  _glfw_dlsym(_glfw.glx.handle, "glXGetFBConfigAttrib");
289  _glfw.glx.GetClientString =
290  _glfw_dlsym(_glfw.glx.handle, "glXGetClientString");
291  _glfw.glx.QueryExtension =
292  _glfw_dlsym(_glfw.glx.handle, "glXQueryExtension");
293  _glfw.glx.QueryVersion =
294  _glfw_dlsym(_glfw.glx.handle, "glXQueryVersion");
295  _glfw.glx.DestroyContext =
296  _glfw_dlsym(_glfw.glx.handle, "glXDestroyContext");
297  _glfw.glx.MakeCurrent =
298  _glfw_dlsym(_glfw.glx.handle, "glXMakeCurrent");
299  _glfw.glx.SwapBuffers =
300  _glfw_dlsym(_glfw.glx.handle, "glXSwapBuffers");
301  _glfw.glx.QueryExtensionsString =
302  _glfw_dlsym(_glfw.glx.handle, "glXQueryExtensionsString");
303  _glfw.glx.CreateNewContext =
304  _glfw_dlsym(_glfw.glx.handle, "glXCreateNewContext");
305  _glfw.glx.CreateWindow =
306  _glfw_dlsym(_glfw.glx.handle, "glXCreateWindow");
307  _glfw.glx.DestroyWindow =
308  _glfw_dlsym(_glfw.glx.handle, "glXDestroyWindow");
309  _glfw.glx.GetProcAddress =
310  _glfw_dlsym(_glfw.glx.handle, "glXGetProcAddress");
311  _glfw.glx.GetProcAddressARB =
312  _glfw_dlsym(_glfw.glx.handle, "glXGetProcAddressARB");
313  _glfw.glx.GetVisualFromFBConfig =
314  _glfw_dlsym(_glfw.glx.handle, "glXGetVisualFromFBConfig");
315 
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)
331  {
333  "GLX: Failed to load required entry points");
334  return GLFW_FALSE;
335  }
336 
337  if (!glXQueryExtension(_glfw.x11.display,
338  &_glfw.glx.errorBase,
339  &_glfw.glx.eventBase))
340  {
341  _glfwInputError(GLFW_API_UNAVAILABLE, "GLX: GLX extension not found");
342  return GLFW_FALSE;
343  }
344 
345  if (!glXQueryVersion(_glfw.x11.display, &_glfw.glx.major, &_glfw.glx.minor))
346  {
348  "GLX: Failed to query GLX version");
349  return GLFW_FALSE;
350  }
351 
352  if (_glfw.glx.major == 1 && _glfw.glx.minor < 3)
353  {
355  "GLX: GLX version 1.3 is required");
356  return GLFW_FALSE;
357  }
358 
359  if (extensionSupportedGLX("GLX_EXT_swap_control"))
360  {
361  _glfw.glx.SwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)
362  getProcAddressGLX("glXSwapIntervalEXT");
363 
364  if (_glfw.glx.SwapIntervalEXT)
365  _glfw.glx.EXT_swap_control = GLFW_TRUE;
366  }
367 
368  if (extensionSupportedGLX("GLX_SGI_swap_control"))
369  {
370  _glfw.glx.SwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)
371  getProcAddressGLX("glXSwapIntervalSGI");
372 
373  if (_glfw.glx.SwapIntervalSGI)
374  _glfw.glx.SGI_swap_control = GLFW_TRUE;
375  }
376 
377  if (extensionSupportedGLX("GLX_MESA_swap_control"))
378  {
379  _glfw.glx.SwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)
380  getProcAddressGLX("glXSwapIntervalMESA");
381 
382  if (_glfw.glx.SwapIntervalMESA)
383  _glfw.glx.MESA_swap_control = GLFW_TRUE;
384  }
385 
386  if (extensionSupportedGLX("GLX_ARB_multisample"))
387  _glfw.glx.ARB_multisample = GLFW_TRUE;
388 
389  if (extensionSupportedGLX("GLX_ARB_framebuffer_sRGB"))
390  _glfw.glx.ARB_framebuffer_sRGB = GLFW_TRUE;
391 
392  if (extensionSupportedGLX("GLX_EXT_framebuffer_sRGB"))
393  _glfw.glx.EXT_framebuffer_sRGB = GLFW_TRUE;
394 
395  if (extensionSupportedGLX("GLX_ARB_create_context"))
396  {
397  _glfw.glx.CreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)
398  getProcAddressGLX("glXCreateContextAttribsARB");
399 
400  if (_glfw.glx.CreateContextAttribsARB)
401  _glfw.glx.ARB_create_context = GLFW_TRUE;
402  }
403 
404  if (extensionSupportedGLX("GLX_ARB_create_context_robustness"))
405  _glfw.glx.ARB_create_context_robustness = GLFW_TRUE;
406 
407  if (extensionSupportedGLX("GLX_ARB_create_context_profile"))
408  _glfw.glx.ARB_create_context_profile = GLFW_TRUE;
409 
410  if (extensionSupportedGLX("GLX_EXT_create_context_es2_profile"))
411  _glfw.glx.EXT_create_context_es2_profile = GLFW_TRUE;
412 
413  if (extensionSupportedGLX("GLX_ARB_create_context_no_error"))
414  _glfw.glx.ARB_create_context_no_error = GLFW_TRUE;
415 
416  if (extensionSupportedGLX("GLX_ARB_context_flush_control"))
417  _glfw.glx.ARB_context_flush_control = GLFW_TRUE;
418 
419  return GLFW_TRUE;
420 }
421 
422 // Terminate GLX
423 //
425 {
426  // NOTE: This function must not call any X11 functions, as it is called
427  // after XCloseDisplay (see _glfwPlatformTerminate for details)
428 
429  if (_glfw.glx.handle)
430  {
432  _glfw.glx.handle = NULL;
433  }
434 }
435 
436 #define setAttrib(a, v) \
437 { \
438  assert((size_t) (index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
439  attribs[index++] = a; \
440  attribs[index++] = v; \
441 }
442 
443 // Create the OpenGL or OpenGL ES context
444 //
446  const _GLFWctxconfig* ctxconfig,
447  const _GLFWfbconfig* fbconfig)
448 {
449  int attribs[40];
450  GLXFBConfig native = NULL;
451  GLXContext share = NULL;
452 
453  if (ctxconfig->share)
454  share = ctxconfig->share->context.glx.handle;
455 
456  if (!chooseGLXFBConfig(fbconfig, &native))
457  {
459  "GLX: Failed to find a suitable GLXFBConfig");
460  return GLFW_FALSE;
461  }
462 
463  if (ctxconfig->client == GLFW_OPENGL_ES_API)
464  {
465  if (!_glfw.glx.ARB_create_context ||
466  !_glfw.glx.ARB_create_context_profile ||
467  !_glfw.glx.EXT_create_context_es2_profile)
468  {
470  "GLX: OpenGL ES requested but GLX_EXT_create_context_es2_profile is unavailable");
471  return GLFW_FALSE;
472  }
473  }
474 
475  if (ctxconfig->forward)
476  {
477  if (!_glfw.glx.ARB_create_context)
478  {
480  "GLX: Forward compatibility requested but GLX_ARB_create_context_profile is unavailable");
481  return GLFW_FALSE;
482  }
483  }
484 
485  if (ctxconfig->profile)
486  {
487  if (!_glfw.glx.ARB_create_context ||
488  !_glfw.glx.ARB_create_context_profile)
489  {
491  "GLX: An OpenGL profile requested but GLX_ARB_create_context_profile is unavailable");
492  return GLFW_FALSE;
493  }
494  }
495 
497 
498  if (_glfw.glx.ARB_create_context)
499  {
500  int index = 0, mask = 0, flags = 0;
501 
502  if (ctxconfig->client == GLFW_OPENGL_API)
503  {
504  if (ctxconfig->forward)
506 
507  if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE)
509  else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE)
511  }
512  else
514 
515  if (ctxconfig->debug)
517 
518  if (ctxconfig->robustness)
519  {
520  if (_glfw.glx.ARB_create_context_robustness)
521  {
522  if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION)
523  {
526  }
527  else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET)
528  {
531  }
532 
534  }
535  }
536 
537  if (ctxconfig->release)
538  {
539  if (_glfw.glx.ARB_context_flush_control)
540  {
541  if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE)
542  {
545  }
546  else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH)
547  {
550  }
551  }
552  }
553 
554  if (ctxconfig->noerror)
555  {
556  if (_glfw.glx.ARB_create_context_no_error)
558  }
559 
560  // NOTE: Only request an explicitly versioned context when necessary, as
561  // explicitly requesting version 1.0 does not always return the
562  // highest version supported by the driver
563  if (ctxconfig->major != 1 || ctxconfig->minor != 0)
564  {
567  }
568 
569  if (mask)
571 
572  if (flags)
574 
575  setAttrib(None, None);
576 
577  window->context.glx.handle =
578  _glfw.glx.CreateContextAttribsARB(_glfw.x11.display,
579  native,
580  share,
581  True,
582  attribs);
583 
584  // HACK: This is a fallback for broken versions of the Mesa
585  // implementation of GLX_ARB_create_context_profile that fail
586  // default 1.0 context creation with a GLXBadProfileARB error in
587  // violation of the extension spec
588  if (!window->context.glx.handle)
589  {
590  if (_glfw.x11.errorCode == _glfw.glx.errorBase + GLXBadProfileARB &&
591  ctxconfig->client == GLFW_OPENGL_API &&
592  ctxconfig->profile == GLFW_OPENGL_ANY_PROFILE &&
593  ctxconfig->forward == GLFW_FALSE)
594  {
595  window->context.glx.handle =
596  createLegacyContextGLX(window, native, share);
597  }
598  }
599  }
600  else
601  {
602  window->context.glx.handle =
603  createLegacyContextGLX(window, native, share);
604  }
605 
607 
608  if (!window->context.glx.handle)
609  {
610  _glfwInputErrorX11(GLFW_VERSION_UNAVAILABLE, "GLX: Failed to create context");
611  return GLFW_FALSE;
612  }
613 
614  window->context.glx.window =
615  glXCreateWindow(_glfw.x11.display, native, window->x11.handle, NULL);
616  if (!window->context.glx.window)
617  {
618  _glfwInputError(GLFW_PLATFORM_ERROR, "GLX: Failed to create window");
619  return GLFW_FALSE;
620  }
621 
628 
629  return GLFW_TRUE;
630 }
631 
632 #undef setAttrib
633 
634 // Returns the Visual and depth of the chosen GLXFBConfig
635 //
637  const _GLFWctxconfig* ctxconfig,
638  const _GLFWfbconfig* fbconfig,
639  Visual** visual, int* depth)
640 {
641  GLXFBConfig native;
642  XVisualInfo* result;
643 
644  if (!chooseGLXFBConfig(fbconfig, &native))
645  {
647  "GLX: Failed to find a suitable GLXFBConfig");
648  return GLFW_FALSE;
649  }
650 
651  result = glXGetVisualFromFBConfig(_glfw.x11.display, native);
652  if (!result)
653  {
655  "GLX: Failed to retrieve Visual for GLXFBConfig");
656  return GLFW_FALSE;
657  }
658 
659  *visual = result->visual;
660  *depth = result->depth;
661 
662  XFree(result);
663  return GLFW_TRUE;
664 }
665 
666 
670 
672 {
673  _GLFWwindow* window = (_GLFWwindow*) handle;
675 
676  if (window->context.client == GLFW_NO_API)
677  {
679  return NULL;
680  }
681 
682  return window->context.glx.handle;
683 }
684 
686 {
687  _GLFWwindow* window = (_GLFWwindow*) handle;
689 
690  if (window->context.client == GLFW_NO_API)
691  {
693  return None;
694  }
695 
696  return window->context.glx.window;
697 }
698 
#define GLX_CONTEXT_MINOR_VERSION_ARB
Definition: glx_context.h:57
#define glXGetFBConfigAttrib
Definition: glx_context.h:97
_GLFWswapbuffersfun swapBuffers
Definition: internal.h:349
#define GLX_STENCIL_SIZE
Definition: glx_context.h:42
#define GLX_DRAWABLE_TYPE
Definition: glx_context.h:31
#define GLX_NO_RESET_NOTIFICATION_ARB
Definition: glx_context.h:63
#define GLFW_OPENGL_ES_API
Definition: glfw3.h:991
_GLFWwindow * share
Definition: internal.h:297
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
Definition: glx_context.h:65
#define glXSwapBuffers
Definition: glx_context.h:103
#define GLX_RED_SIZE
Definition: glx_context.h:37
_GLFWgetprocaddressfun getProcAddress
Definition: internal.h:352
#define GLFWAPI
Definition: glfw3.h:240
#define GLX_WINDOW_BIT
Definition: glx_context.h:30
#define GLFW_OPENGL_COMPAT_PROFILE
Definition: glfw3.h:999
GLFWbool _glfwChooseVisualGLX(const _GLFWwndconfig *wndconfig, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig, Visual **visual, int *depth)
Definition: glx_context.c:636
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB
Definition: glx_context.h:64
_GLFWtls contextSlot
Definition: internal.h:536
const GLint * attribs
Definition: glext.h:11230
#define glXQueryExtensionsString
Definition: glx_context.h:104
GLFWbool sRGB
Definition: internal.h:326
uintptr_t handle
Definition: internal.h:329
#define GLX_CONTEXT_DEBUG_BIT_ARB
Definition: glx_context.h:51
GLuint64 GLenum void * handle
Definition: glext.h:7785
static int getGLXFBConfigAttrib(GLXFBConfig fbconfig, int attrib)
Definition: glx_context.c:41
_GLFWdestroycontextfun destroy
Definition: internal.h:353
GLFWAPI GLXContext glfwGetGLXContext(GLFWwindow *handle)
Definition: glx_context.c:671
GLfloat value
GLint GLuint mask
int accumGreenBits
Definition: internal.h:320
#define GLX_RENDER_TYPE
Definition: glx_context.h:32
#define GLX_VENDOR
Definition: glx_context.h:28
GLXContext(* PFNGLXCREATECONTEXTATTRIBSARBPROC)(Display *, GLXFBConfig, GLXContext, Bool, const int *)
Definition: glx_context.h:93
#define GLFW_FALSE
Zero.
Definition: glfw3.h:287
#define glXGetVisualFromFBConfig
Definition: glx_context.h:106
#define _glfw_dlopen(name)
GLint GLint GLsizei GLsizei GLsizei depth
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
Definition: glfw3.h:753
GLFWbool _glfwInitGLX(void)
Definition: glx_context.c:253
GLFWbool forward
Definition: internal.h:291
#define glXGetClientString
Definition: glx_context.h:98
#define GLFW_LOSE_CONTEXT_ON_RESET
Definition: glfw3.h:995
static void destroyContextGLX(_GLFWwindow *window)
Definition: glx_context.c:231
#define GLX_RGBA_BIT
Definition: glx_context.h:29
#define GLX_GREEN_SIZE
Definition: glx_context.h:38
#define GLFW_OPENGL_ANY_PROFILE
Definition: glfw3.h:997
#define GLFW_OPENGL_API
Definition: glfw3.h:990
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
Definition: glfw3.h:698
#define glXQueryVersion
Definition: glx_context.h:100
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
Definition: glfw3.h:745
int(* PFNGLXSWAPINTERVALSGIPROC)(int)
Definition: glx_context.h:92
int stencilBits
Definition: internal.h:318
GLdouble n
Definition: glext.h:1966
#define GLFW_RELEASE_BEHAVIOR_NONE
Definition: glfw3.h:1012
_GLFWcontext context
Definition: internal.h:394
XID GLXWindow
Definition: glx_context.h:69
int GLFWbool
Definition: internal.h:61
struct __GLXcontext * GLXContext
Definition: glx_context.h:72
void * handle
Definition: internal.h:547
khronos_uint8_t GLubyte
void _glfwGrabErrorHandlerX11(void)
Definition: x11_init.c:855
GLuint index
#define GLX_ACCUM_ALPHA_SIZE
Definition: glx_context.h:46
void(* GLFWglproc)(void)
GLFWbool transparent
Definition: internal.h:328
#define glXMakeCurrent
Definition: glx_context.h:102
#define _glfw_dlclose(handle)
#define GLX_DOUBLEBUFFER
Definition: glx_context.h:34
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
Definition: internal.h:210
#define GLX_CONTEXT_FLAGS_ARB
Definition: glx_context.h:58
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
Definition: context.c:176
#define GLX_AUX_BUFFERS
Definition: glx_context.h:36
#define glXCreateWindow
Definition: glx_context.h:107
GLFWbool _glfwIsVisualTransparentX11(Visual *visual)
Definition: x11_window.c:1885
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
Definition: glfw3.h:726
void _glfwInputErrorX11(int error, const char *message)
Definition: x11_init.c:872
_GLFWlibrary _glfw
Definition: init.c:44
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
Definition: glx_context.h:52
#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB
Definition: glx_context.h:67
#define GLX_CONTEXT_PROFILE_MASK_ARB
Definition: glx_context.h:54
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
Definition: context.c:580
_W64 unsigned int uintptr_t
Definition: stdint.h:119
#define GLX_ACCUM_RED_SIZE
Definition: glx_context.h:43
int accumBlueBits
Definition: internal.h:321
#define GLXBadProfileARB
Definition: glx_context.c:35
GLFWbool noerror
Definition: internal.h:293
GLbitfield flags
_GLFWmakecontextcurrentfun makeCurrent
Definition: internal.h:348
#define GLX_ALPHA_SIZE
Definition: glx_context.h:40
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
Definition: glx_context.h:62
static int extensionSupportedGLX(const char *extension)
Definition: glx_context.c:206
#define GLX_ACCUM_BLUE_SIZE
Definition: glx_context.h:45
static void swapBuffersGLX(_GLFWwindow *window)
Definition: glx_context.c:182
int auxBuffers
Definition: internal.h:323
void _glfwInputError(int code, const char *format,...)
Definition: init.c:129
static void swapIntervalGLX(int interval)
Definition: glx_context.c:187
#define GLX_STEREO
Definition: glx_context.h:35
_GLFWextensionsupportedfun extensionSupported
Definition: internal.h:351
static void makeContextCurrentGLX(_GLFWwindow *window)
Definition: glx_context.c:156
GLFWbool debug
Definition: internal.h:292
#define GLFW_RELEASE_BEHAVIOR_FLUSH
Definition: glfw3.h:1011
#define GLX_SAMPLES
Definition: glx_context.h:47
GLFWbool _glfwCreateContextGLX(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: glx_context.c:445
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
Definition: glfw3.h:715
_GLFWswapintervalfun swapInterval
Definition: internal.h:350
GLFWAPI GLXWindow glfwGetGLXWindow(GLFWwindow *handle)
Definition: glx_context.c:685
#define GLX_DEPTH_SIZE
Definition: glx_context.h:41
#define GLFW_TRUE
One.
Definition: glfw3.h:279
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
Definition: posix_thread.c:66
void _glfwTerminateGLX(void)
Definition: glx_context.c:424
static GLXContext createLegacyContextGLX(_GLFWwindow *window, GLXFBConfig fbconfig, GLXContext share)
Definition: glx_context.c:145
GLFWbool stereo
Definition: internal.h:324
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
Definition: glx_context.h:55
#define glXGetFBConfigs
Definition: glx_context.h:96
void _glfwReleaseErrorHandlerX11(void)
Definition: x11_init.c:863
#define GLFW_OPENGL_CORE_PROFILE
Definition: glfw3.h:998
int(* PFNGLXSWAPINTERVALMESAPROC)(int)
Definition: glx_context.h:91
#define glXDestroyContext
Definition: glx_context.h:101
#define GLX_CONTEXT_MAJOR_VERSION_ARB
Definition: glx_context.h:56
void * _glfwPlatformGetTls(_GLFWtls *tls)
Definition: posix_thread.c:60
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT
Definition: glx_context.h:59
struct __GLXFBConfig * GLXFBConfig
Definition: glx_context.h:71
static GLFWglproc getProcAddressGLX(const char *procname)
Definition: glx_context.c:219
#define setAttrib(a, v)
Definition: glx_context.c:436
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB
Definition: glx_context.h:53
int accumAlphaBits
Definition: internal.h:322
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB
Definition: glx_context.h:60
GLFWbool doublebuffer
Definition: internal.h:327
#define NULL
Definition: tinycthread.c:47
#define glXQueryExtension
Definition: glx_context.h:99
int i
#define GLX_ACCUM_GREEN_SIZE
Definition: glx_context.h:44
#define glXDestroyWindow
Definition: glx_context.h:108
#define GLX_RGBA_TYPE
Definition: glx_context.h:33
#define glXCreateNewContext
Definition: glx_context.h:105
#define _glfw_dlsym(handle, name)
#define GLX_BLUE_SIZE
Definition: glx_context.h:39
static GLFWbool chooseGLXFBConfig(const _GLFWfbconfig *desired, GLXFBConfig *result)
Definition: glx_context.c:50
void(* PFNGLXSWAPINTERVALEXTPROC)(Display *, GLXDrawable, int)
Definition: glx_context.h:86
GLuint64EXT * result
Definition: glext.h:10921
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB
Definition: glx_context.h:50
#define GLFW_NO_RESET_NOTIFICATION
Definition: glfw3.h:994
struct GLFWwindow GLFWwindow
int accumRedBits
Definition: internal.h:319
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
Definition: glx_context.h:66
#define GLX_LOSE_CONTEXT_ON_RESET_ARB
Definition: glx_context.h:61
#define GLFW_NO_API
Definition: glfw3.h:989


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:47:16