Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

glx.h 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. /* $Id: glx.h,v 1.31 2001/09/14 02:43:04 brianp Exp $ */
  2. /*
  3. * Mesa 3-D graphics library
  4. * Version: 3.5
  5. *
  6. * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
  7. *
  8. * Permission is hereby granted, free of charge, to any person obtaining a
  9. * copy of this software and associated documentation files (the "Software"),
  10. * to deal in the Software without restriction, including without limitation
  11. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  12. * and/or sell copies of the Software, and to permit persons to whom the
  13. * Software is furnished to do so, subject to the following conditions:
  14. *
  15. * The above copyright notice and this permission notice shall be included
  16. * in all copies or substantial portions of the Software.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  19. * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  21. * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  22. * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  23. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24. */
  25. #ifndef GLX_H
  26. #define GLX_H
  27. #ifdef __VMS
  28. #include <GL/vms_x_fix.h>
  29. # ifdef __cplusplus
  30. /* VMS Xlib.h gives problems with C++.
  31. * this avoids a bunch of trivial warnings */
  32. #pragma message disable nosimpint
  33. #endif
  34. #endif
  35. #include <X11/Xlib.h>
  36. #include <X11/Xutil.h>
  37. #ifdef __VMS
  38. # ifdef __cplusplus
  39. #pragma message enable nosimpint
  40. #endif
  41. #endif
  42. #include <GL/gl.h>
  43. #if defined(USE_MGL_NAMESPACE)
  44. #include <GL/glx_mangle.h>
  45. #endif
  46. #ifdef __cplusplus
  47. extern "C" {
  48. #endif
  49. #define GLX_VERSION_1_1 1
  50. #define GLX_VERSION_1_2 1
  51. #define GLX_VERSION_1_3 1
  52. #define GLX_VERSION_1_4 1
  53. #define GLX_EXTENSION_NAME "GLX"
  54. /*
  55. * Tokens for glXChooseVisual and glXGetConfig:
  56. */
  57. #define GLX_USE_GL 1
  58. #define GLX_BUFFER_SIZE 2
  59. #define GLX_LEVEL 3
  60. #define GLX_RGBA 4
  61. #define GLX_DOUBLEBUFFER 5
  62. #define GLX_STEREO 6
  63. #define GLX_AUX_BUFFERS 7
  64. #define GLX_RED_SIZE 8
  65. #define GLX_GREEN_SIZE 9
  66. #define GLX_BLUE_SIZE 10
  67. #define GLX_ALPHA_SIZE 11
  68. #define GLX_DEPTH_SIZE 12
  69. #define GLX_STENCIL_SIZE 13
  70. #define GLX_ACCUM_RED_SIZE 14
  71. #define GLX_ACCUM_GREEN_SIZE 15
  72. #define GLX_ACCUM_BLUE_SIZE 16
  73. #define GLX_ACCUM_ALPHA_SIZE 17
  74. /*
  75. * Error codes returned by glXGetConfig:
  76. */
  77. #define GLX_BAD_SCREEN 1
  78. #define GLX_BAD_ATTRIBUTE 2
  79. #define GLX_NO_EXTENSION 3
  80. #define GLX_BAD_VISUAL 4
  81. #define GLX_BAD_CONTEXT 5
  82. #define GLX_BAD_VALUE 6
  83. #define GLX_BAD_ENUM 7
  84. /*
  85. * GLX 1.1 and later:
  86. */
  87. #define GLX_VENDOR 1
  88. #define GLX_VERSION 2
  89. #define GLX_EXTENSIONS 3
  90. /*
  91. * GLX 1.3 and later:
  92. */
  93. #define GLX_CONFIG_CAVEAT 0x20
  94. #define GLX_DONT_CARE 0xFFFFFFFF
  95. #define GLX_SLOW_CONFIG 0x8001
  96. #define GLX_NON_CONFORMANT_CONFIG 0x800D
  97. #define GLX_X_VISUAL_TYPE 0x22
  98. #define GLX_TRANSPARENT_TYPE 0x23
  99. #define GLX_TRANSPARENT_INDEX_VALUE 0x24
  100. #define GLX_TRANSPARENT_RED_VALUE 0x25
  101. #define GLX_TRANSPARENT_GREEN_VALUE 0x26
  102. #define GLX_TRANSPARENT_BLUE_VALUE 0x27
  103. #define GLX_TRANSPARENT_ALPHA_VALUE 0x28
  104. #define GLX_MAX_PBUFFER_WIDTH 0x8016
  105. #define GLX_MAX_PBUFFER_HEIGHT 0x8017
  106. #define GLX_MAX_PBUFFER_PIXELS 0x8018
  107. #define GLX_PRESERVED_CONTENTS 0x801B
  108. #define GLX_LARGEST_PBUFFER 0x801C
  109. #define GLX_WIDTH 0x801D
  110. #define GLX_HEIGHT 0x801E
  111. #define GLX_EVENT_MASK 0x801F
  112. #define GLX_DRAWABLE_TYPE 0x8010
  113. #define GLX_FBCONFIG_ID 0x8013
  114. #define GLX_VISUAL_ID 0x800B
  115. #define GLX_WINDOW_BIT 0x00000001
  116. #define GLX_PIXMAP_BIT 0x00000002
  117. #define GLX_PBUFFER_BIT 0x00000004
  118. #define GLX_AUX_BUFFERS_BIT 0x00000010
  119. #define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
  120. #define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
  121. #define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
  122. #define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
  123. #define GLX_AUX_BUFFERS_BIT 0x00000010
  124. #define GLX_DEPTH_BUFFER_BIT 0x00000020
  125. #define GLX_STENCIL_BUFFER_BIT 0x00000040
  126. #define GLX_ACCUM_BUFFER_BIT 0x00000080
  127. #define GLX_DRAWABLE_TYPE 0x8010
  128. #define GLX_RENDER_TYPE 0x8011
  129. #define GLX_X_RENDERABLE 0x8012
  130. #define GLX_NONE 0x8000
  131. #define GLX_TRUE_COLOR 0x8002
  132. #define GLX_DIRECT_COLOR 0x8003
  133. #define GLX_PSEUDO_COLOR 0x8004
  134. #define GLX_STATIC_COLOR 0x8005
  135. #define GLX_GRAY_SCALE 0x8006
  136. #define GLX_STATIC_GRAY 0x8007
  137. #define GLX_TRANSPARENT_INDEX 0x8009
  138. #define GLX_RGBA_TYPE 0x8014
  139. #define GLX_COLOR_INDEX_TYPE 0x8015
  140. #define GLX_COLOR_INDEX_BIT 0x00000002
  141. #define GLX_RGBA_BIT 0x00000001
  142. #define GLX_SCREEN 0x800C
  143. #define GLX_PBUFFER_CLOBBER_MASK 0x08000000
  144. #define GLX_DAMAGED 0x8020
  145. #define GLX_SAVED 0x8021
  146. #define GLX_WINDOW 0x8022
  147. #define GLX_PBUFFER 0x8023
  148. #define GLX_PBUFFER_HEIGHT 0x8040
  149. #define GLX_PBUFFER_WIDTH 0x8041
  150. /*
  151. * GLX 1.4 and later:
  152. */
  153. #define GLX_SAMPLE_BUFFERS_SGIS 100000
  154. #define GLX_SAMPLES_SGIS 100001
  155. typedef struct __GLXcontextRec *GLXContext;
  156. typedef XID GLXPixmap;
  157. typedef XID GLXDrawable;
  158. /* GLX 1.3 and later */
  159. typedef struct __GLXFBConfigRec *GLXFBConfig;
  160. typedef XID GLXFBConfigID;
  161. typedef XID GLXContextID;
  162. typedef XID GLXWindow;
  163. typedef XID GLXPbuffer;
  164. extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
  165. int *attribList );
  166. extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
  167. GLXContext shareList, Bool direct );
  168. extern void glXDestroyContext( Display *dpy, GLXContext ctx );
  169. extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
  170. GLXContext ctx);
  171. extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
  172. unsigned long mask );
  173. extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
  174. extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
  175. Pixmap pixmap );
  176. extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
  177. extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
  178. extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
  179. extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
  180. extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
  181. int attrib, int *value );
  182. extern GLXContext glXGetCurrentContext( void );
  183. extern GLXDrawable glXGetCurrentDrawable( void );
  184. extern void glXWaitGL( void );
  185. extern void glXWaitX( void );
  186. extern void glXUseXFont( Font font, int first, int count, int list );
  187. /* GLX 1.1 and later */
  188. extern const char *glXQueryExtensionsString( Display *dpy, int screen );
  189. extern const char *glXQueryServerString( Display *dpy, int screen, int name );
  190. extern const char *glXGetClientString( Display *dpy, int name );
  191. /* GLX 1.2 and later */
  192. extern Display *glXGetCurrentDisplay( void );
  193. /* GLX 1.3 and later */
  194. extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
  195. const int *attribList, int *nitems );
  196. extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
  197. int attribute, int *value );
  198. extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
  199. int *nelements );
  200. extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
  201. GLXFBConfig config );
  202. extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
  203. Window win, const int *attribList );
  204. extern void glXDestroyWindow( Display *dpy, GLXWindow window );
  205. extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
  206. Pixmap pixmap, const int *attribList );
  207. extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
  208. extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
  209. const int *attribList );
  210. extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
  211. extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
  212. unsigned int *value );
  213. extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
  214. int renderType, GLXContext shareList,
  215. Bool direct );
  216. extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
  217. GLXDrawable read, GLXContext ctx );
  218. extern GLXDrawable glXGetCurrentReadDrawable( void );
  219. extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
  220. int *value );
  221. extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
  222. unsigned long mask );
  223. extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
  224. unsigned long *mask );
  225. /* GLX 1.4 and later */
  226. extern void (*glXGetProcAddress(const GLubyte *procname))();
  227. #ifndef GLX_GLXEXT_LEGACY
  228. #include <GL/glxext.h>
  229. #else
  230. /*
  231. * 28. GLX_EXT_visual_info extension
  232. */
  233. #ifndef GLX_EXT_visual_info
  234. #define GLX_EXT_visual_info 1
  235. #define GLX_X_VISUAL_TYPE_EXT 0x22
  236. #define GLX_TRANSPARENT_TYPE_EXT 0x23
  237. #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
  238. #define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
  239. #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
  240. #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
  241. #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
  242. #define GLX_TRUE_COLOR_EXT 0x8002
  243. #define GLX_DIRECT_COLOR_EXT 0x8003
  244. #define GLX_PSEUDO_COLOR_EXT 0x8004
  245. #define GLX_STATIC_COLOR_EXT 0x8005
  246. #define GLX_GRAY_SCALE_EXT 0x8006
  247. #define GLX_STATIC_GRAY_EXT 0x8007
  248. #define GLX_NONE_EXT 0x8000
  249. #define GLX_TRANSPARENT_RGB_EXT 0x8008
  250. #define GLX_TRANSPARENT_INDEX_EXT 0x8009
  251. #endif /* 28. GLX_EXT_visual_info extension */
  252. /*
  253. * 41. GLX_SGI_video_sync
  254. */
  255. #ifndef GLX_SGI_video_sync
  256. #define GLX_SGI_video_sync 1
  257. extern int glXGetVideoSyncSGI(unsigned int *count);
  258. extern int glXWaitVideoSyncSGI(int divisor, int remainder, unsigned int *count);
  259. #endif /* GLX_SGI_video_sync */
  260. /*
  261. * 42. GLX_EXT_visual_rating
  262. */
  263. #ifndef GLX_EXT_visual_rating
  264. #define GLX_EXT_visual_rating 1
  265. #define GLX_VISUAL_CAVEAT_EXT 0x20
  266. /*#define GLX_NONE_EXT 0x8000*/
  267. #define GLX_SLOW_VISUAL_EXT 0x8001
  268. #define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
  269. #endif /* GLX_EXT_visual_rating */
  270. /*
  271. * 47. GLX_EXT_import_context
  272. */
  273. #ifndef GLX_EXT_import_context
  274. #define GLX_EXT_import_context 1
  275. #define GLX_SHARE_CONTEXT_EXT 0x800A
  276. #define GLX_VISUAL_ID_EXT 0x800B
  277. #define GLX_SCREEN_EXT 0x800C
  278. extern void glXFreeContextEXT(Display *dpy, GLXContext context);
  279. extern GLXContextID glXGetContextIDEXT(const GLXContext context);
  280. extern Display *glXGetCurrentDisplayEXT(void);
  281. extern GLXContext glXImportContextEXT(Display *dpy, GLXContextID contextID);
  282. extern int glXQueryContextInfoEXT(Display *dpy, GLXContext context,
  283. int attribute,int *value);
  284. #endif /* GLX_EXT_import_context */
  285. /*
  286. * 215. GLX_MESA_copy_sub_buffer
  287. */
  288. #ifndef GLX_MESA_copy_sub_buffer
  289. #define GLX_MESA_copy_sub_buffer 1
  290. extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
  291. int x, int y, int width, int height );
  292. #endif
  293. /*
  294. * 216. GLX_MESA_pixmap_colormap
  295. */
  296. #ifndef GLX_MESA_pixmap_colormap
  297. #define GLX_MESA_pixmap_colormap 1
  298. extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
  299. Pixmap pixmap, Colormap cmap );
  300. #endif /* GLX_MESA_pixmap_colormap */
  301. /*
  302. * 217. GLX_MESA_release_buffers
  303. */
  304. #ifndef GLX_MESA_release_buffers
  305. #define GLX_MESA_release_buffers 1
  306. extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
  307. #endif /* GLX_MESA_release_buffers */
  308. /*
  309. * 218. GLX_MESA_set_3dfx_mode
  310. */
  311. #ifndef GLX_MESA_set_3dfx_mode
  312. #define GLX_MESA_set_3dfx_mode 1
  313. #define GLX_3DFX_WINDOW_MODE_MESA 0x1
  314. #define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
  315. extern Bool glXSet3DfxModeMESA( int mode );
  316. #endif /* GLX_MESA_set_3dfx_mode */
  317. /*
  318. * ARB 2. GLX_ARB_get_proc_address
  319. */
  320. #ifndef GLX_ARB_get_proc_address
  321. #define GLX_ARB_get_proc_address 1
  322. extern void (*glXGetProcAddressARB(const GLubyte *procName))();
  323. #endif /* GLX_ARB_get_proc_address */
  324. #endif /* GLX_GLXEXT_LEGACY */
  325. #ifdef __cplusplus
  326. }
  327. #endif
  328. #endif