glplatform-glx.c 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. #ifndef _WIN32
  2. extern void (*glXGetProcAddress(const unsigned char *))(void);
  3. static inline void *LoadProcAddress(const char *name) { return glXGetProcAddress((const unsigned char *)name); }
  4. #include <stdio.h>
  5. #else
  6. #include <windows.h>
  7. #include <wingdi.h>
  8. #include <stdio.h>
  9. static PROC LoadProcAddress(const char *name) {
  10. PROC addr = wglGetProcAddress((LPCSTR)name);
  11. if (addr) return addr;
  12. else return (PROC)GetProcAddress(GetModuleHandleA("OpenGL32.dll"), (LPCSTR)name);
  13. }
  14. #endif
  15. #define GLPLATFORM_GLX_VERSION 14
  16. #define GLPLATFORM_ENABLE_GLX_3DFX_multisample
  17. #define GLPLATFORM_ENABLE_GLX_AMD_gpu_association
  18. #define GLPLATFORM_ENABLE_GLX_ARB_context_flush_control
  19. #define GLPLATFORM_ENABLE_GLX_ARB_create_context
  20. #define GLPLATFORM_ENABLE_GLX_ARB_create_context_profile
  21. #define GLPLATFORM_ENABLE_GLX_ARB_create_context_robustness
  22. #define GLPLATFORM_ENABLE_GLX_ARB_fbconfig_float
  23. #define GLPLATFORM_ENABLE_GLX_ARB_framebuffer_sRGB
  24. #define GLPLATFORM_ENABLE_GLX_ARB_get_proc_address
  25. #define GLPLATFORM_ENABLE_GLX_ARB_multisample
  26. #define GLPLATFORM_ENABLE_GLX_ARB_robustness_application_isolation
  27. #define GLPLATFORM_ENABLE_GLX_ARB_robustness_share_group_isolation
  28. #define GLPLATFORM_ENABLE_GLX_ARB_vertex_buffer_object
  29. #define GLPLATFORM_ENABLE_GLX_EXT_buffer_age
  30. #define GLPLATFORM_ENABLE_GLX_EXT_create_context_es2_profile
  31. #define GLPLATFORM_ENABLE_GLX_EXT_create_context_es_profile
  32. #define GLPLATFORM_ENABLE_GLX_EXT_fbconfig_packed_float
  33. #define GLPLATFORM_ENABLE_GLX_EXT_framebuffer_sRGB
  34. #define GLPLATFORM_ENABLE_GLX_EXT_import_context
  35. #define GLPLATFORM_ENABLE_GLX_EXT_stereo_tree
  36. #define GLPLATFORM_ENABLE_GLX_EXT_swap_control
  37. #define GLPLATFORM_ENABLE_GLX_EXT_swap_control_tear
  38. #define GLPLATFORM_ENABLE_GLX_EXT_texture_from_pixmap
  39. #define GLPLATFORM_ENABLE_GLX_EXT_visual_info
  40. #define GLPLATFORM_ENABLE_GLX_EXT_visual_rating
  41. #define GLPLATFORM_ENABLE_GLX_INTEL_swap_event
  42. #define GLPLATFORM_ENABLE_GLX_MESA_agp_offset
  43. #define GLPLATFORM_ENABLE_GLX_MESA_copy_sub_buffer
  44. #define GLPLATFORM_ENABLE_GLX_MESA_pixmap_colormap
  45. #define GLPLATFORM_ENABLE_GLX_MESA_query_renderer
  46. #define GLPLATFORM_ENABLE_GLX_MESA_release_buffers
  47. #define GLPLATFORM_ENABLE_GLX_MESA_set_3dfx_mode
  48. #define GLPLATFORM_ENABLE_GLX_NV_copy_buffer
  49. #define GLPLATFORM_ENABLE_GLX_NV_copy_image
  50. #define GLPLATFORM_ENABLE_GLX_NV_delay_before_swap
  51. #define GLPLATFORM_ENABLE_GLX_NV_float_buffer
  52. #define GLPLATFORM_ENABLE_GLX_NV_multisample_coverage
  53. #define GLPLATFORM_ENABLE_GLX_NV_present_video
  54. #define GLPLATFORM_ENABLE_GLX_NV_swap_group
  55. #define GLPLATFORM_ENABLE_GLX_NV_video_capture
  56. #define GLPLATFORM_ENABLE_GLX_NV_video_out
  57. #define GLPLATFORM_ENABLE_GLX_OML_swap_method
  58. #define GLPLATFORM_ENABLE_GLX_OML_sync_control
  59. #define GLPLATFORM_ENABLE_GLX_SGI_swap_control
  60. #define GLPLATFORM_ENABLE_GLX_SUN_get_transparent_index
  61. #include "glplatform-glx.h"
  62. Bool (*glXBindSwapBarrierNV)(Display *, GLuint, GLuint) = NULL;
  63. void (*glXBindTexImageEXT)(Display *, GLXDrawable, int , const int *) = NULL;
  64. int (*glXBindVideoCaptureDeviceNV)(Display *, unsigned int , GLXVideoCaptureDeviceNV) = NULL;
  65. int (*glXBindVideoDeviceNV)(Display *, unsigned int , unsigned int , const int *) = NULL;
  66. int (*glXBindVideoImageNV)(Display *, GLXVideoDeviceNV, GLXPbuffer, int ) = NULL;
  67. void (*glXBlitContextFramebufferAMD)(GLXContext, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) = NULL;
  68. GLXFBConfig * (*glXChooseFBConfig)(Display *, int , const int *, int *) = NULL;
  69. XVisualInfo * (*glXChooseVisual)(Display *, int , int *) = NULL;
  70. void (*glXCopyBufferSubDataNV)(Display *, GLXContext, GLXContext, GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr) = NULL;
  71. void (*glXCopyContext)(Display *, GLXContext, GLXContext, unsigned long ) = NULL;
  72. void (*glXCopyImageSubDataNV)(Display *, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) = NULL;
  73. void (*glXCopySubBufferMESA)(Display *, GLXDrawable, int , int , int , int ) = NULL;
  74. GLXContext (*glXCreateAssociatedContextAMD)(unsigned int , GLXContext) = NULL;
  75. GLXContext (*glXCreateAssociatedContextAttribsAMD)(unsigned int , GLXContext, const int *) = NULL;
  76. GLXContext (*glXCreateContext)(Display *, XVisualInfo *, GLXContext, Bool) = NULL;
  77. GLXContext (*glXCreateContextAttribsARB)(Display *, GLXFBConfig, GLXContext, Bool, const int *) = NULL;
  78. GLXPixmap (*glXCreateGLXPixmap)(Display *, XVisualInfo *, Pixmap) = NULL;
  79. GLXPixmap (*glXCreateGLXPixmapMESA)(Display *, XVisualInfo *, Pixmap, Colormap) = NULL;
  80. GLXContext (*glXCreateNewContext)(Display *, GLXFBConfig, int , GLXContext, Bool) = NULL;
  81. GLXPbuffer (*glXCreatePbuffer)(Display *, GLXFBConfig, const int *) = NULL;
  82. GLXPixmap (*glXCreatePixmap)(Display *, GLXFBConfig, Pixmap, const int *) = NULL;
  83. GLXWindow (*glXCreateWindow)(Display *, GLXFBConfig, Window, const int *) = NULL;
  84. Bool (*glXDelayBeforeSwapNV)(Display *, GLXDrawable, GLfloat) = NULL;
  85. Bool (*glXDeleteAssociatedContextAMD)(GLXContext) = NULL;
  86. void (*glXDestroyContext)(Display *, GLXContext) = NULL;
  87. void (*glXDestroyGLXPixmap)(Display *, GLXPixmap) = NULL;
  88. void (*glXDestroyPbuffer)(Display *, GLXPbuffer) = NULL;
  89. void (*glXDestroyPixmap)(Display *, GLXPixmap) = NULL;
  90. void (*glXDestroyWindow)(Display *, GLXWindow) = NULL;
  91. GLXVideoCaptureDeviceNV * (*glXEnumerateVideoCaptureDevicesNV)(Display *, int , int *) = NULL;
  92. unsigned int * (*glXEnumerateVideoDevicesNV)(Display *, int , int *) = NULL;
  93. void (*glXFreeContextEXT)(Display *, GLXContext) = NULL;
  94. unsigned int (*glXGetAGPOffsetMESA)(const void *) = NULL;
  95. const char * (*glXGetClientString)(Display *, int ) = NULL;
  96. int (*glXGetConfig)(Display *, XVisualInfo *, int , int *) = NULL;
  97. unsigned int (*glXGetContextGPUIDAMD)(GLXContext) = NULL;
  98. GLXContextID (*glXGetContextIDEXT)(const GLXContext) = NULL;
  99. GLXContext (*glXGetCurrentAssociatedContextAMD)() = NULL;
  100. GLXContext (*glXGetCurrentContext)() = NULL;
  101. Display * (*glXGetCurrentDisplay)() = NULL;
  102. Display * (*glXGetCurrentDisplayEXT)() = NULL;
  103. GLXDrawable (*glXGetCurrentDrawable)() = NULL;
  104. GLXDrawable (*glXGetCurrentReadDrawable)() = NULL;
  105. int (*glXGetFBConfigAttrib)(Display *, GLXFBConfig, int , int *) = NULL;
  106. GLXFBConfig * (*glXGetFBConfigs)(Display *, int , int *) = NULL;
  107. unsigned int (*glXGetGPUIDsAMD)(unsigned int , unsigned int *) = NULL;
  108. int (*glXGetGPUInfoAMD)(unsigned int , int , GLenum, unsigned int , void *) = NULL;
  109. Bool (*glXGetMscRateOML)(Display *, GLXDrawable, int32_t *, int32_t *) = NULL;
  110. __GLXextFuncPtr (*glXGetProcAddress)(const GLubyte *) = NULL;
  111. __GLXextFuncPtr (*glXGetProcAddressARB)(const GLubyte *) = NULL;
  112. void (*glXGetSelectedEvent)(Display *, GLXDrawable, unsigned long *) = NULL;
  113. Bool (*glXGetSyncValuesOML)(Display *, GLXDrawable, int64_t *, int64_t *, int64_t *) = NULL;
  114. Status (*glXGetTransparentIndexSUN)(Display *, Window, Window, long *) = NULL;
  115. int (*glXGetVideoDeviceNV)(Display *, int , int , GLXVideoDeviceNV *) = NULL;
  116. int (*glXGetVideoInfoNV)(Display *, int , GLXVideoDeviceNV, unsigned long *, unsigned long *) = NULL;
  117. XVisualInfo * (*glXGetVisualFromFBConfig)(Display *, GLXFBConfig) = NULL;
  118. GLXContext (*glXImportContextEXT)(Display *, GLXContextID) = NULL;
  119. Bool (*glXIsDirect)(Display *, GLXContext) = NULL;
  120. Bool (*glXJoinSwapGroupNV)(Display *, GLXDrawable, GLuint) = NULL;
  121. void (*glXLockVideoCaptureDeviceNV)(Display *, GLXVideoCaptureDeviceNV) = NULL;
  122. Bool (*glXMakeAssociatedContextCurrentAMD)(GLXContext) = NULL;
  123. Bool (*glXMakeContextCurrent)(Display *, GLXDrawable, GLXDrawable, GLXContext) = NULL;
  124. Bool (*glXMakeCurrent)(Display *, GLXDrawable, GLXContext) = NULL;
  125. void (*glXNamedCopyBufferSubDataNV)(Display *, GLXContext, GLXContext, GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr) = NULL;
  126. int (*glXQueryContext)(Display *, GLXContext, int , int *) = NULL;
  127. int (*glXQueryContextInfoEXT)(Display *, GLXContext, int , int *) = NULL;
  128. Bool (*glXQueryCurrentRendererIntegerMESA)(int , unsigned int *) = NULL;
  129. const char * (*glXQueryCurrentRendererStringMESA)(int ) = NULL;
  130. void (*glXQueryDrawable)(Display *, GLXDrawable, int , unsigned int *) = NULL;
  131. Bool (*glXQueryExtension)(Display *, int *, int *) = NULL;
  132. const char * (*glXQueryExtensionsString)(Display *, int ) = NULL;
  133. Bool (*glXQueryFrameCountNV)(Display *, int , GLuint *) = NULL;
  134. Bool (*glXQueryMaxSwapGroupsNV)(Display *, int , GLuint *, GLuint *) = NULL;
  135. Bool (*glXQueryRendererIntegerMESA)(Display *, int , int , int , unsigned int *) = NULL;
  136. const char * (*glXQueryRendererStringMESA)(Display *, int , int , int ) = NULL;
  137. const char * (*glXQueryServerString)(Display *, int , int ) = NULL;
  138. Bool (*glXQuerySwapGroupNV)(Display *, GLXDrawable, GLuint *, GLuint *) = NULL;
  139. Bool (*glXQueryVersion)(Display *, int *, int *) = NULL;
  140. int (*glXQueryVideoCaptureDeviceNV)(Display *, GLXVideoCaptureDeviceNV, int , int *) = NULL;
  141. Bool (*glXReleaseBuffersMESA)(Display *, GLXDrawable) = NULL;
  142. void (*glXReleaseTexImageEXT)(Display *, GLXDrawable, int ) = NULL;
  143. void (*glXReleaseVideoCaptureDeviceNV)(Display *, GLXVideoCaptureDeviceNV) = NULL;
  144. int (*glXReleaseVideoDeviceNV)(Display *, int , GLXVideoDeviceNV) = NULL;
  145. int (*glXReleaseVideoImageNV)(Display *, GLXPbuffer) = NULL;
  146. Bool (*glXResetFrameCountNV)(Display *, int ) = NULL;
  147. void (*glXSelectEvent)(Display *, GLXDrawable, unsigned long ) = NULL;
  148. int (*glXSendPbufferToVideoNV)(Display *, GLXPbuffer, int , unsigned long *, GLboolean) = NULL;
  149. Bool (*glXSet3DfxModeMESA)(int ) = NULL;
  150. void (*glXSwapBuffers)(Display *, GLXDrawable) = NULL;
  151. int64_t (*glXSwapBuffersMscOML)(Display *, GLXDrawable, int64_t, int64_t, int64_t) = NULL;
  152. void (*glXSwapIntervalEXT)(Display *, GLXDrawable, int ) = NULL;
  153. int (*glXSwapIntervalSGI)(int ) = NULL;
  154. void (*glXUseXFont)(Font, int , int , int ) = NULL;
  155. Bool (*glXWaitForMscOML)(Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *) = NULL;
  156. Bool (*glXWaitForSbcOML)(Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *) = NULL;
  157. void (*glXWaitGL)() = NULL;
  158. void (*glXWaitX)() = NULL;
  159. bool GLPLATFORM_GLX_3DFX_multisample = false;
  160. bool GLPLATFORM_GLX_AMD_gpu_association = false;
  161. bool GLPLATFORM_GLX_ARB_context_flush_control = false;
  162. bool GLPLATFORM_GLX_ARB_create_context = false;
  163. bool GLPLATFORM_GLX_ARB_create_context_profile = false;
  164. bool GLPLATFORM_GLX_ARB_create_context_robustness = false;
  165. bool GLPLATFORM_GLX_ARB_fbconfig_float = false;
  166. bool GLPLATFORM_GLX_ARB_framebuffer_sRGB = false;
  167. bool GLPLATFORM_GLX_ARB_get_proc_address = false;
  168. bool GLPLATFORM_GLX_ARB_multisample = false;
  169. bool GLPLATFORM_GLX_ARB_robustness_application_isolation = false;
  170. bool GLPLATFORM_GLX_ARB_robustness_share_group_isolation = false;
  171. bool GLPLATFORM_GLX_ARB_vertex_buffer_object = false;
  172. bool GLPLATFORM_GLX_EXT_buffer_age = false;
  173. bool GLPLATFORM_GLX_EXT_create_context_es2_profile = false;
  174. bool GLPLATFORM_GLX_EXT_create_context_es_profile = false;
  175. bool GLPLATFORM_GLX_EXT_fbconfig_packed_float = false;
  176. bool GLPLATFORM_GLX_EXT_framebuffer_sRGB = false;
  177. bool GLPLATFORM_GLX_EXT_import_context = false;
  178. bool GLPLATFORM_GLX_EXT_stereo_tree = false;
  179. bool GLPLATFORM_GLX_EXT_swap_control = false;
  180. bool GLPLATFORM_GLX_EXT_swap_control_tear = false;
  181. bool GLPLATFORM_GLX_EXT_texture_from_pixmap = false;
  182. bool GLPLATFORM_GLX_EXT_visual_info = false;
  183. bool GLPLATFORM_GLX_EXT_visual_rating = false;
  184. bool GLPLATFORM_GLX_INTEL_swap_event = false;
  185. bool GLPLATFORM_GLX_MESA_agp_offset = false;
  186. bool GLPLATFORM_GLX_MESA_copy_sub_buffer = false;
  187. bool GLPLATFORM_GLX_MESA_pixmap_colormap = false;
  188. bool GLPLATFORM_GLX_MESA_query_renderer = false;
  189. bool GLPLATFORM_GLX_MESA_release_buffers = false;
  190. bool GLPLATFORM_GLX_MESA_set_3dfx_mode = false;
  191. bool GLPLATFORM_GLX_NV_copy_buffer = false;
  192. bool GLPLATFORM_GLX_NV_copy_image = false;
  193. bool GLPLATFORM_GLX_NV_delay_before_swap = false;
  194. bool GLPLATFORM_GLX_NV_float_buffer = false;
  195. bool GLPLATFORM_GLX_NV_multisample_coverage = false;
  196. bool GLPLATFORM_GLX_NV_present_video = false;
  197. bool GLPLATFORM_GLX_NV_swap_group = false;
  198. bool GLPLATFORM_GLX_NV_video_capture = false;
  199. bool GLPLATFORM_GLX_NV_video_out = false;
  200. bool GLPLATFORM_GLX_OML_swap_method = false;
  201. bool GLPLATFORM_GLX_OML_sync_control = false;
  202. bool GLPLATFORM_GLX_SGI_swap_control = false;
  203. bool GLPLATFORM_GLX_SUN_get_transparent_index = false;
  204. bool glplatform_glx_init(int maj, int min)
  205. {
  206. int req_version = maj * 10 + min;
  207. if (req_version < 14) return false;
  208. if (req_version > 14) return false;
  209. glXBindSwapBarrierNV = (Bool (*)(Display *, GLuint, GLuint) ) LoadProcAddress("glXBindSwapBarrierNV");
  210. glXBindTexImageEXT = (void (*)(Display *, GLXDrawable, int , const int *) ) LoadProcAddress("glXBindTexImageEXT");
  211. glXBindVideoCaptureDeviceNV = (int (*)(Display *, unsigned int , GLXVideoCaptureDeviceNV) ) LoadProcAddress("glXBindVideoCaptureDeviceNV");
  212. glXBindVideoDeviceNV = (int (*)(Display *, unsigned int , unsigned int , const int *) ) LoadProcAddress("glXBindVideoDeviceNV");
  213. glXBindVideoImageNV = (int (*)(Display *, GLXVideoDeviceNV, GLXPbuffer, int ) ) LoadProcAddress("glXBindVideoImageNV");
  214. glXBlitContextFramebufferAMD = (void (*)(GLXContext, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum) ) LoadProcAddress("glXBlitContextFramebufferAMD");
  215. glXChooseFBConfig = (GLXFBConfig * (*)(Display *, int , const int *, int *) ) LoadProcAddress("glXChooseFBConfig");
  216. glXChooseVisual = (XVisualInfo * (*)(Display *, int , int *) ) LoadProcAddress("glXChooseVisual");
  217. glXCopyBufferSubDataNV = (void (*)(Display *, GLXContext, GLXContext, GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr) ) LoadProcAddress("glXCopyBufferSubDataNV");
  218. glXCopyContext = (void (*)(Display *, GLXContext, GLXContext, unsigned long ) ) LoadProcAddress("glXCopyContext");
  219. glXCopyImageSubDataNV = (void (*)(Display *, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLXContext, GLuint, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei) ) LoadProcAddress("glXCopyImageSubDataNV");
  220. glXCopySubBufferMESA = (void (*)(Display *, GLXDrawable, int , int , int , int ) ) LoadProcAddress("glXCopySubBufferMESA");
  221. glXCreateAssociatedContextAMD = (GLXContext (*)(unsigned int , GLXContext) ) LoadProcAddress("glXCreateAssociatedContextAMD");
  222. glXCreateAssociatedContextAttribsAMD = (GLXContext (*)(unsigned int , GLXContext, const int *) ) LoadProcAddress("glXCreateAssociatedContextAttribsAMD");
  223. glXCreateContext = (GLXContext (*)(Display *, XVisualInfo *, GLXContext, Bool) ) LoadProcAddress("glXCreateContext");
  224. glXCreateContextAttribsARB = (GLXContext (*)(Display *, GLXFBConfig, GLXContext, Bool, const int *) ) LoadProcAddress("glXCreateContextAttribsARB");
  225. glXCreateGLXPixmap = (GLXPixmap (*)(Display *, XVisualInfo *, Pixmap) ) LoadProcAddress("glXCreateGLXPixmap");
  226. glXCreateGLXPixmapMESA = (GLXPixmap (*)(Display *, XVisualInfo *, Pixmap, Colormap) ) LoadProcAddress("glXCreateGLXPixmapMESA");
  227. glXCreateNewContext = (GLXContext (*)(Display *, GLXFBConfig, int , GLXContext, Bool) ) LoadProcAddress("glXCreateNewContext");
  228. glXCreatePbuffer = (GLXPbuffer (*)(Display *, GLXFBConfig, const int *) ) LoadProcAddress("glXCreatePbuffer");
  229. glXCreatePixmap = (GLXPixmap (*)(Display *, GLXFBConfig, Pixmap, const int *) ) LoadProcAddress("glXCreatePixmap");
  230. glXCreateWindow = (GLXWindow (*)(Display *, GLXFBConfig, Window, const int *) ) LoadProcAddress("glXCreateWindow");
  231. glXDelayBeforeSwapNV = (Bool (*)(Display *, GLXDrawable, GLfloat) ) LoadProcAddress("glXDelayBeforeSwapNV");
  232. glXDeleteAssociatedContextAMD = (Bool (*)(GLXContext) ) LoadProcAddress("glXDeleteAssociatedContextAMD");
  233. glXDestroyContext = (void (*)(Display *, GLXContext) ) LoadProcAddress("glXDestroyContext");
  234. glXDestroyGLXPixmap = (void (*)(Display *, GLXPixmap) ) LoadProcAddress("glXDestroyGLXPixmap");
  235. glXDestroyPbuffer = (void (*)(Display *, GLXPbuffer) ) LoadProcAddress("glXDestroyPbuffer");
  236. glXDestroyPixmap = (void (*)(Display *, GLXPixmap) ) LoadProcAddress("glXDestroyPixmap");
  237. glXDestroyWindow = (void (*)(Display *, GLXWindow) ) LoadProcAddress("glXDestroyWindow");
  238. glXEnumerateVideoCaptureDevicesNV = (GLXVideoCaptureDeviceNV * (*)(Display *, int , int *) ) LoadProcAddress("glXEnumerateVideoCaptureDevicesNV");
  239. glXEnumerateVideoDevicesNV = (unsigned int * (*)(Display *, int , int *) ) LoadProcAddress("glXEnumerateVideoDevicesNV");
  240. glXFreeContextEXT = (void (*)(Display *, GLXContext) ) LoadProcAddress("glXFreeContextEXT");
  241. glXGetAGPOffsetMESA = (unsigned int (*)(const void *) ) LoadProcAddress("glXGetAGPOffsetMESA");
  242. glXGetClientString = (const char * (*)(Display *, int ) ) LoadProcAddress("glXGetClientString");
  243. glXGetConfig = (int (*)(Display *, XVisualInfo *, int , int *) ) LoadProcAddress("glXGetConfig");
  244. glXGetContextGPUIDAMD = (unsigned int (*)(GLXContext) ) LoadProcAddress("glXGetContextGPUIDAMD");
  245. glXGetContextIDEXT = (GLXContextID (*)(const GLXContext) ) LoadProcAddress("glXGetContextIDEXT");
  246. glXGetCurrentAssociatedContextAMD = (GLXContext (*)() ) LoadProcAddress("glXGetCurrentAssociatedContextAMD");
  247. glXGetCurrentContext = (GLXContext (*)() ) LoadProcAddress("glXGetCurrentContext");
  248. glXGetCurrentDisplay = (Display * (*)() ) LoadProcAddress("glXGetCurrentDisplay");
  249. glXGetCurrentDisplayEXT = (Display * (*)() ) LoadProcAddress("glXGetCurrentDisplayEXT");
  250. glXGetCurrentDrawable = (GLXDrawable (*)() ) LoadProcAddress("glXGetCurrentDrawable");
  251. glXGetCurrentReadDrawable = (GLXDrawable (*)() ) LoadProcAddress("glXGetCurrentReadDrawable");
  252. glXGetFBConfigAttrib = (int (*)(Display *, GLXFBConfig, int , int *) ) LoadProcAddress("glXGetFBConfigAttrib");
  253. glXGetFBConfigs = (GLXFBConfig * (*)(Display *, int , int *) ) LoadProcAddress("glXGetFBConfigs");
  254. glXGetGPUIDsAMD = (unsigned int (*)(unsigned int , unsigned int *) ) LoadProcAddress("glXGetGPUIDsAMD");
  255. glXGetGPUInfoAMD = (int (*)(unsigned int , int , GLenum, unsigned int , void *) ) LoadProcAddress("glXGetGPUInfoAMD");
  256. glXGetMscRateOML = (Bool (*)(Display *, GLXDrawable, int32_t *, int32_t *) ) LoadProcAddress("glXGetMscRateOML");
  257. glXGetProcAddress = (__GLXextFuncPtr (*)(const GLubyte *) ) LoadProcAddress("glXGetProcAddress");
  258. glXGetProcAddressARB = (__GLXextFuncPtr (*)(const GLubyte *) ) LoadProcAddress("glXGetProcAddressARB");
  259. glXGetSelectedEvent = (void (*)(Display *, GLXDrawable, unsigned long *) ) LoadProcAddress("glXGetSelectedEvent");
  260. glXGetSyncValuesOML = (Bool (*)(Display *, GLXDrawable, int64_t *, int64_t *, int64_t *) ) LoadProcAddress("glXGetSyncValuesOML");
  261. glXGetTransparentIndexSUN = (Status (*)(Display *, Window, Window, long *) ) LoadProcAddress("glXGetTransparentIndexSUN");
  262. glXGetVideoDeviceNV = (int (*)(Display *, int , int , GLXVideoDeviceNV *) ) LoadProcAddress("glXGetVideoDeviceNV");
  263. glXGetVideoInfoNV = (int (*)(Display *, int , GLXVideoDeviceNV, unsigned long *, unsigned long *) ) LoadProcAddress("glXGetVideoInfoNV");
  264. glXGetVisualFromFBConfig = (XVisualInfo * (*)(Display *, GLXFBConfig) ) LoadProcAddress("glXGetVisualFromFBConfig");
  265. glXImportContextEXT = (GLXContext (*)(Display *, GLXContextID) ) LoadProcAddress("glXImportContextEXT");
  266. glXIsDirect = (Bool (*)(Display *, GLXContext) ) LoadProcAddress("glXIsDirect");
  267. glXJoinSwapGroupNV = (Bool (*)(Display *, GLXDrawable, GLuint) ) LoadProcAddress("glXJoinSwapGroupNV");
  268. glXLockVideoCaptureDeviceNV = (void (*)(Display *, GLXVideoCaptureDeviceNV) ) LoadProcAddress("glXLockVideoCaptureDeviceNV");
  269. glXMakeAssociatedContextCurrentAMD = (Bool (*)(GLXContext) ) LoadProcAddress("glXMakeAssociatedContextCurrentAMD");
  270. glXMakeContextCurrent = (Bool (*)(Display *, GLXDrawable, GLXDrawable, GLXContext) ) LoadProcAddress("glXMakeContextCurrent");
  271. glXMakeCurrent = (Bool (*)(Display *, GLXDrawable, GLXContext) ) LoadProcAddress("glXMakeCurrent");
  272. glXNamedCopyBufferSubDataNV = (void (*)(Display *, GLXContext, GLXContext, GLuint, GLuint, GLintptr, GLintptr, GLsizeiptr) ) LoadProcAddress("glXNamedCopyBufferSubDataNV");
  273. glXQueryContext = (int (*)(Display *, GLXContext, int , int *) ) LoadProcAddress("glXQueryContext");
  274. glXQueryContextInfoEXT = (int (*)(Display *, GLXContext, int , int *) ) LoadProcAddress("glXQueryContextInfoEXT");
  275. glXQueryCurrentRendererIntegerMESA = (Bool (*)(int , unsigned int *) ) LoadProcAddress("glXQueryCurrentRendererIntegerMESA");
  276. glXQueryCurrentRendererStringMESA = (const char * (*)(int ) ) LoadProcAddress("glXQueryCurrentRendererStringMESA");
  277. glXQueryDrawable = (void (*)(Display *, GLXDrawable, int , unsigned int *) ) LoadProcAddress("glXQueryDrawable");
  278. glXQueryExtension = (Bool (*)(Display *, int *, int *) ) LoadProcAddress("glXQueryExtension");
  279. glXQueryExtensionsString = (const char * (*)(Display *, int ) ) LoadProcAddress("glXQueryExtensionsString");
  280. glXQueryFrameCountNV = (Bool (*)(Display *, int , GLuint *) ) LoadProcAddress("glXQueryFrameCountNV");
  281. glXQueryMaxSwapGroupsNV = (Bool (*)(Display *, int , GLuint *, GLuint *) ) LoadProcAddress("glXQueryMaxSwapGroupsNV");
  282. glXQueryRendererIntegerMESA = (Bool (*)(Display *, int , int , int , unsigned int *) ) LoadProcAddress("glXQueryRendererIntegerMESA");
  283. glXQueryRendererStringMESA = (const char * (*)(Display *, int , int , int ) ) LoadProcAddress("glXQueryRendererStringMESA");
  284. glXQueryServerString = (const char * (*)(Display *, int , int ) ) LoadProcAddress("glXQueryServerString");
  285. glXQuerySwapGroupNV = (Bool (*)(Display *, GLXDrawable, GLuint *, GLuint *) ) LoadProcAddress("glXQuerySwapGroupNV");
  286. glXQueryVersion = (Bool (*)(Display *, int *, int *) ) LoadProcAddress("glXQueryVersion");
  287. glXQueryVideoCaptureDeviceNV = (int (*)(Display *, GLXVideoCaptureDeviceNV, int , int *) ) LoadProcAddress("glXQueryVideoCaptureDeviceNV");
  288. glXReleaseBuffersMESA = (Bool (*)(Display *, GLXDrawable) ) LoadProcAddress("glXReleaseBuffersMESA");
  289. glXReleaseTexImageEXT = (void (*)(Display *, GLXDrawable, int ) ) LoadProcAddress("glXReleaseTexImageEXT");
  290. glXReleaseVideoCaptureDeviceNV = (void (*)(Display *, GLXVideoCaptureDeviceNV) ) LoadProcAddress("glXReleaseVideoCaptureDeviceNV");
  291. glXReleaseVideoDeviceNV = (int (*)(Display *, int , GLXVideoDeviceNV) ) LoadProcAddress("glXReleaseVideoDeviceNV");
  292. glXReleaseVideoImageNV = (int (*)(Display *, GLXPbuffer) ) LoadProcAddress("glXReleaseVideoImageNV");
  293. glXResetFrameCountNV = (Bool (*)(Display *, int ) ) LoadProcAddress("glXResetFrameCountNV");
  294. glXSelectEvent = (void (*)(Display *, GLXDrawable, unsigned long ) ) LoadProcAddress("glXSelectEvent");
  295. glXSendPbufferToVideoNV = (int (*)(Display *, GLXPbuffer, int , unsigned long *, GLboolean) ) LoadProcAddress("glXSendPbufferToVideoNV");
  296. glXSet3DfxModeMESA = (Bool (*)(int ) ) LoadProcAddress("glXSet3DfxModeMESA");
  297. glXSwapBuffers = (void (*)(Display *, GLXDrawable) ) LoadProcAddress("glXSwapBuffers");
  298. glXSwapBuffersMscOML = (int64_t (*)(Display *, GLXDrawable, int64_t, int64_t, int64_t) ) LoadProcAddress("glXSwapBuffersMscOML");
  299. glXSwapIntervalEXT = (void (*)(Display *, GLXDrawable, int ) ) LoadProcAddress("glXSwapIntervalEXT");
  300. glXSwapIntervalSGI = (int (*)(int ) ) LoadProcAddress("glXSwapIntervalSGI");
  301. glXUseXFont = (void (*)(Font, int , int , int ) ) LoadProcAddress("glXUseXFont");
  302. glXWaitForMscOML = (Bool (*)(Display *, GLXDrawable, int64_t, int64_t, int64_t, int64_t *, int64_t *, int64_t *) ) LoadProcAddress("glXWaitForMscOML");
  303. glXWaitForSbcOML = (Bool (*)(Display *, GLXDrawable, int64_t, int64_t *, int64_t *, int64_t *) ) LoadProcAddress("glXWaitForSbcOML");
  304. glXWaitGL = (void (*)() ) LoadProcAddress("glXWaitGL");
  305. glXWaitX = (void (*)() ) LoadProcAddress("glXWaitX");
  306. GLPLATFORM_GLX_AMD_gpu_association = GLPLATFORM_GLX_AMD_gpu_association && glXBlitContextFramebufferAMD && glXCreateAssociatedContextAMD
  307. && glXCreateAssociatedContextAttribsAMD && glXDeleteAssociatedContextAMD && glXGetContextGPUIDAMD
  308. && glXGetCurrentAssociatedContextAMD && glXGetGPUIDsAMD && glXGetGPUInfoAMD
  309. && glXMakeAssociatedContextCurrentAMD;
  310. GLPLATFORM_GLX_ARB_create_context = GLPLATFORM_GLX_ARB_create_context && glXCreateContextAttribsARB;
  311. GLPLATFORM_GLX_ARB_get_proc_address = GLPLATFORM_GLX_ARB_get_proc_address && glXGetProcAddressARB;
  312. GLPLATFORM_GLX_EXT_import_context = GLPLATFORM_GLX_EXT_import_context && glXFreeContextEXT && glXGetContextIDEXT
  313. && glXGetCurrentDisplayEXT && glXImportContextEXT && glXQueryContextInfoEXT;
  314. GLPLATFORM_GLX_EXT_swap_control = GLPLATFORM_GLX_EXT_swap_control && glXSwapIntervalEXT;
  315. GLPLATFORM_GLX_EXT_texture_from_pixmap = GLPLATFORM_GLX_EXT_texture_from_pixmap && glXBindTexImageEXT && glXReleaseTexImageEXT;
  316. GLPLATFORM_GLX_MESA_agp_offset = GLPLATFORM_GLX_MESA_agp_offset && glXGetAGPOffsetMESA;
  317. GLPLATFORM_GLX_MESA_copy_sub_buffer = GLPLATFORM_GLX_MESA_copy_sub_buffer && glXCopySubBufferMESA;
  318. GLPLATFORM_GLX_MESA_pixmap_colormap = GLPLATFORM_GLX_MESA_pixmap_colormap && glXCreateGLXPixmapMESA;
  319. GLPLATFORM_GLX_MESA_query_renderer = GLPLATFORM_GLX_MESA_query_renderer && glXQueryCurrentRendererIntegerMESA && glXQueryCurrentRendererStringMESA
  320. && glXQueryRendererIntegerMESA && glXQueryRendererStringMESA;
  321. GLPLATFORM_GLX_MESA_release_buffers = GLPLATFORM_GLX_MESA_release_buffers && glXReleaseBuffersMESA;
  322. GLPLATFORM_GLX_MESA_set_3dfx_mode = GLPLATFORM_GLX_MESA_set_3dfx_mode && glXSet3DfxModeMESA;
  323. GLPLATFORM_GLX_NV_copy_buffer = GLPLATFORM_GLX_NV_copy_buffer && glXCopyBufferSubDataNV && glXNamedCopyBufferSubDataNV;
  324. GLPLATFORM_GLX_NV_copy_image = GLPLATFORM_GLX_NV_copy_image && glXCopyImageSubDataNV;
  325. GLPLATFORM_GLX_NV_delay_before_swap = GLPLATFORM_GLX_NV_delay_before_swap && glXDelayBeforeSwapNV;
  326. GLPLATFORM_GLX_NV_present_video = GLPLATFORM_GLX_NV_present_video && glXBindVideoDeviceNV && glXEnumerateVideoDevicesNV;
  327. GLPLATFORM_GLX_NV_swap_group = GLPLATFORM_GLX_NV_swap_group && glXBindSwapBarrierNV && glXJoinSwapGroupNV
  328. && glXQueryFrameCountNV && glXQueryMaxSwapGroupsNV && glXQuerySwapGroupNV
  329. && glXResetFrameCountNV;
  330. GLPLATFORM_GLX_NV_video_capture = GLPLATFORM_GLX_NV_video_capture && glXBindVideoCaptureDeviceNV && glXEnumerateVideoCaptureDevicesNV
  331. && glXLockVideoCaptureDeviceNV && glXQueryVideoCaptureDeviceNV && glXReleaseVideoCaptureDeviceNV;
  332. GLPLATFORM_GLX_NV_video_out = GLPLATFORM_GLX_NV_video_out && glXBindVideoImageNV && glXGetVideoDeviceNV
  333. && glXGetVideoInfoNV && glXReleaseVideoDeviceNV && glXReleaseVideoImageNV
  334. && glXSendPbufferToVideoNV;
  335. GLPLATFORM_GLX_OML_sync_control = GLPLATFORM_GLX_OML_sync_control && glXGetMscRateOML && glXGetSyncValuesOML
  336. && glXSwapBuffersMscOML && glXWaitForMscOML && glXWaitForSbcOML;
  337. GLPLATFORM_GLX_SGI_swap_control = GLPLATFORM_GLX_SGI_swap_control && glXSwapIntervalSGI;
  338. GLPLATFORM_GLX_SUN_get_transparent_index = GLPLATFORM_GLX_SUN_get_transparent_index && glXGetTransparentIndexSUN;
  339. return glXChooseFBConfig && glXChooseVisual
  340. && glXCopyContext && glXCreateContext && glXCreateGLXPixmap
  341. && glXCreateNewContext && glXCreatePbuffer && glXCreatePixmap
  342. && glXCreateWindow && glXDestroyContext && glXDestroyGLXPixmap
  343. && glXDestroyPbuffer && glXDestroyPixmap && glXDestroyWindow
  344. && glXGetClientString && glXGetConfig && glXGetCurrentContext
  345. && glXGetCurrentDisplay && glXGetCurrentDrawable && glXGetCurrentReadDrawable
  346. && glXGetFBConfigAttrib && glXGetFBConfigs && glXGetProcAddress
  347. && glXGetSelectedEvent && glXGetVisualFromFBConfig && glXIsDirect
  348. && glXMakeContextCurrent && glXMakeCurrent && glXQueryContext
  349. && glXQueryDrawable && glXQueryExtension && glXQueryExtensionsString
  350. && glXQueryServerString && glXQueryVersion && glXSelectEvent
  351. && glXSwapBuffers && glXUseXFont && glXWaitGL
  352. && glXWaitX;
  353. }