Clone of mesa.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362
  1. /* $Id: glx.h,v 1.15 2000/03/06 12:59:24 joukj Exp $ */
  2. /*
  3. * Mesa 3-D graphics library
  4. * Version: 3.3
  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. # ifdef __cplusplus
  29. /* VMS Xlib.h gives problems with C++.
  30. * this avoids a bunch of trivial warnings */
  31. #pragma message disable nosimpint
  32. #endif
  33. #endif
  34. #include <X11/Xlib.h>
  35. #include <X11/Xutil.h>
  36. #ifdef __VMS
  37. # ifdef __cplusplus
  38. #pragma message enable nosimpint
  39. #endif
  40. #endif
  41. #include "GL/gl.h"
  42. #ifdef MESA
  43. #include "GL/xmesa.h"
  44. #endif
  45. #if defined(USE_MGL_NAMESPACE)
  46. #include "glx_mangle.h"
  47. #endif
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. #define GLX_VERSION_1_1 1
  52. #define GLX_VERSION_1_2 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. * XXX don't know the values of some of these enums!
  93. * XXX some 1.3 enums may be missing!
  94. */
  95. #define GLX_CONFIG_CAVEAT ?
  96. #define GLX_DONT_CARE ?
  97. #define GLX_SLOW_CONFIG ?
  98. #define GLX_NON_CONFORMANT_CONFIG ?
  99. #define GLX_X_VISUAL_TYPE 0x22
  100. #define GLX_TRANSPARENT_TYPE 0x23
  101. #define GLX_TRANSPARENT_INDEX_VALUE 0x24
  102. #define GLX_TRANSPARENT_RED_VALUE 0x25
  103. #define GLX_TRANSPARENT_GREEN_VALUE 0x26
  104. #define GLX_TRANSPARENT_BLUE_VALUE 0x27
  105. #define GLX_TRANSPARENT_ALPHA_VALUE 0x28
  106. #define GLX_MAX_PBUFFER_WIDTH ?
  107. #define GLX_MAX_PBUFFER_HEIGHT ?
  108. #define GLX_MAX_PBUFFER_PIXELS ?
  109. #define GLX_PRESERVED_CONTENTS ?
  110. #define GLX_LARGEST_BUFFER ?
  111. #define GLX_DRAWABLE_TYPE ?
  112. #define GLX_FBCONFIG_ID ?
  113. #define GLX_VISUAL_ID ?
  114. #define GLX_WINDOW_BIT ?
  115. #define GLX_PIXMAP_BIT ?
  116. #define GLX_PBUFFER_BIT ?
  117. #define GLX_AUX_BUFFERS_BIT ?
  118. #define GLX_FRONT_LEFT_BUFFER_BIT ?
  119. #define GLX_FRONT_RIGHT_BUFFER_BIT ?
  120. #define GLX_BACK_LEFT_BUFFER_BIT ?
  121. #define GLX_BACK_RIGHT_BUFFER_BIT ?
  122. #define GLX_AUX_BUFFERS_BIT ?
  123. #define GLX_DEPTH_BUFFER_BIT ?
  124. #define GLX_STENCIL_BUFFER_BIT ?
  125. #define GLX_ACCUM_BUFFER_BIT ?
  126. #define GLX_RENDER_TYPE ?
  127. #define GLX_DRAWABLE_TYPE ?
  128. #define GLX_X_RENDERABLE ?
  129. #define GLX_NONE 0x8000
  130. #define GLX_TRUE_COLOR 0x8002
  131. #define GLX_DIRECT_COLOR 0x8003
  132. #define GLX_PSEUDO_COLOR 0x8004
  133. #define GLX_STATIC_COLOR 0x8005
  134. #define GLX_GRAY_SCALE 0x8006
  135. #define GLX_STATIC_GRAY 0x8007
  136. #define GLX_TRANSPARENT_INDEX 0x8009
  137. #define GLX_COLOR_INDEX_TYPE ?
  138. #define GLX_COLOR_INDEX_BIT ?
  139. #define GLX_SCREEN ?
  140. #define GLX_PBUFFER_CLOBBER_MASK ?
  141. #define GLX_DAMAGED ?
  142. #define GLX_SAVED ?
  143. #define GLX_WINDOW ?
  144. #define GLX_PBUFFER ?
  145. /*
  146. * GLX_EXT_visual_info extension
  147. */
  148. #define GLX_X_VISUAL_TYPE_EXT 0x22
  149. #define GLX_TRANSPARENT_TYPE_EXT 0x23
  150. #define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
  151. #define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
  152. #define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
  153. #define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
  154. #define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
  155. /*
  156. * GLX_visual_info extension
  157. */
  158. #define GLX_TRUE_COLOR_EXT 0x8002
  159. #define GLX_DIRECT_COLOR_EXT 0x8003
  160. #define GLX_PSEUDO_COLOR_EXT 0x8004
  161. #define GLX_STATIC_COLOR_EXT 0x8005
  162. #define GLX_GRAY_SCALE_EXT 0x8006
  163. #define GLX_STATIC_GRAY_EXT 0x8007
  164. #define GLX_NONE_EXT 0x8000
  165. #define GLX_TRANSPARENT_RGB_EXT 0x8008
  166. #define GLX_TRANSPARENT_INDEX_EXT 0x8009
  167. /*
  168. * Compile-time extension tests
  169. */
  170. #define GLX_EXT_visual_info 1
  171. #define GLX_MESA_pixmap_colormap 1
  172. #define GLX_MESA_release_buffers 1
  173. #define GLX_MESA_copy_sub_buffer 1
  174. #define GLX_MESA_set_3dfx_mode 1
  175. #define GLX_SGI_video_sync 1
  176. #define GLX_ARB_get_proc_address 1
  177. #ifdef MESA
  178. typedef XMesaContext GLXContext;
  179. typedef Pixmap GLXPixmap;
  180. typedef Drawable GLXDrawable;
  181. #else
  182. typedef void * GLXContext;
  183. typedef XID GLXPixmap;
  184. typedef XID GLXDrawable;
  185. /* GLX 1.3 and later */
  186. typedef XID GLXFBConfigID;
  187. typedef XID GLXPfuffer;
  188. typedef XID GLXWindow;
  189. typedef XID GLXPbuffer;
  190. typedef XID GLXFBConfig;
  191. #endif
  192. typedef XID GLXContextID;
  193. extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
  194. int *attribList );
  195. extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
  196. GLXContext shareList, Bool direct );
  197. extern void glXDestroyContext( Display *dpy, GLXContext ctx );
  198. extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
  199. GLXContext ctx);
  200. extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
  201. unsigned long mask );
  202. extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
  203. extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
  204. Pixmap pixmap );
  205. extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
  206. extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
  207. extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
  208. extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
  209. extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
  210. int attrib, int *value );
  211. extern GLXContext glXGetCurrentContext( void );
  212. extern GLXDrawable glXGetCurrentDrawable( void );
  213. extern void glXWaitGL( void );
  214. extern void glXWaitX( void );
  215. extern void glXUseXFont( Font font, int first, int count, int list );
  216. /* GLX 1.1 and later */
  217. extern const char *glXQueryExtensionsString( Display *dpy, int screen );
  218. extern const char *glXQueryServerString( Display *dpy, int screen, int name );
  219. extern const char *glXGetClientString( Display *dpy, int name );
  220. /* GLX 1.2 and later */
  221. extern Display *glXGetCurrentDisplay( void );
  222. /* GLX 1.3 and later */
  223. extern GLXFBConfig glXChooseFBConfig( Display *dpy, int screen,
  224. const int *attribList, int *nitems );
  225. extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
  226. int attribute, int *value );
  227. extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
  228. GLXFBConfig config );
  229. extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
  230. Window win, const int *attribList );
  231. extern void glXDestroyWindow( Display *dpy, GLXWindow window );
  232. extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
  233. Pixmap pixmap, const int *attribList );
  234. extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
  235. extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
  236. const int *attribList );
  237. extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
  238. extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
  239. unsigned int *value );
  240. extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
  241. int renderType, GLXContext shareList,
  242. Bool direct );
  243. extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
  244. GLXDrawable read, GLXContext ctx );
  245. extern GLXDrawable glXGetCurrentReadDrawable( void );
  246. extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
  247. int *value );
  248. extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
  249. unsigned long mask );
  250. extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
  251. unsigned long *mask );
  252. /* GLX_MESA_pixmap_colormap */
  253. extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
  254. Pixmap pixmap, Colormap cmap );
  255. /* GLX_MESA_release_buffers */
  256. extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
  257. /* GLX_MESA_copy_sub_buffer */
  258. extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
  259. int x, int y, int width, int height );
  260. /* GLX_MESA_set_3dfx_mode */
  261. extern GLboolean glXSet3DfxModeMESA( GLint mode );
  262. /* GLX_SGI_video_sync */
  263. extern int glXGetVideoSyncSGI(unsigned int *count);
  264. extern int glXWaitVideoSyncSGI(int divisor, int remainder,
  265. unsigned int *count);
  266. /* GLX_ARB_get_proc_address */
  267. extern void (*glXGetProcAddressARB(const GLubyte *procName))();
  268. #ifdef __cplusplus
  269. }
  270. #endif
  271. #endif