Clone of mesa.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /* $Id: glx.h,v 1.2 1999/09/11 11:33:45 brianp Exp $ */
  2. /*
  3. * Mesa 3-D graphics library
  4. * Version: 3.1
  5. *
  6. * Copyright (C) 1999 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. /*
  26. * $Log: glx.h,v $
  27. * Revision 1.2 1999/09/11 11:33:45 brianp
  28. * added GLX_EXT_get_proc_address
  29. *
  30. * Revision 1.1.1.1 1999/08/19 00:55:40 jtg
  31. * Imported sources
  32. *
  33. * Revision 3.3 1999/02/14 03:39:09 brianp
  34. * new copyright
  35. *
  36. * Revision 3.2 1998/06/18 03:44:00 brianp
  37. * replaced "uint" with "unsigned int"
  38. *
  39. * Revision 3.1 1998/06/01 00:00:17 brianp
  40. * added GLX_SGI_video_sync extension
  41. *
  42. * Revision 3.0 1998/02/20 05:06:01 brianp
  43. * initial rev
  44. *
  45. */
  46. #ifndef GLX_H
  47. #define GLX_H
  48. /*
  49. * A pseudo-GLX implementation to allow GLX-based OpenGL programs to
  50. * work with Mesa.
  51. *
  52. * Notes:
  53. * 1. If the visual passed to glXGetConfig was not one returned by
  54. * glXChooseVisual then the GLX_RGBA and GLX_DOUBLEBUFFER queries
  55. * will always return True and the GLX_DEPTH_SIZE query will always
  56. * return non-zero.
  57. * 2. The glXIsDirect() function always returns True.
  58. */
  59. #include <X11/Xlib.h>
  60. #include <X11/Xutil.h>
  61. #include "GL/gl.h"
  62. #ifdef MESA
  63. #include "GL/xmesa.h"
  64. #endif
  65. #if defined(USE_MGL_NAMESPACE)
  66. #include "glx_mangle.h"
  67. #endif
  68. #ifdef __cplusplus
  69. extern "C" {
  70. #endif
  71. #define GLX_VERSION_1_1 1
  72. /*
  73. * Tokens for glXChooseVisual and glXGetConfig:
  74. */
  75. enum _GLX_CONFIGS {
  76. GLX_USE_GL = 1,
  77. GLX_BUFFER_SIZE = 2,
  78. GLX_LEVEL = 3,
  79. GLX_RGBA = 4,
  80. GLX_DOUBLEBUFFER = 5,
  81. GLX_STEREO = 6,
  82. GLX_AUX_BUFFERS = 7,
  83. GLX_RED_SIZE = 8,
  84. GLX_GREEN_SIZE = 9,
  85. GLX_BLUE_SIZE = 10,
  86. GLX_ALPHA_SIZE = 11,
  87. GLX_DEPTH_SIZE = 12,
  88. GLX_STENCIL_SIZE = 13,
  89. GLX_ACCUM_RED_SIZE = 14,
  90. GLX_ACCUM_GREEN_SIZE = 15,
  91. GLX_ACCUM_BLUE_SIZE = 16,
  92. GLX_ACCUM_ALPHA_SIZE = 17,
  93. /* GLX_EXT_visual_info extension */
  94. GLX_X_VISUAL_TYPE_EXT = 0x22,
  95. GLX_TRANSPARENT_TYPE_EXT = 0x23,
  96. GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24,
  97. GLX_TRANSPARENT_RED_VALUE_EXT = 0x25,
  98. GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26,
  99. GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27,
  100. GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28
  101. };
  102. /*
  103. * Error codes returned by glXGetConfig:
  104. */
  105. #define GLX_BAD_SCREEN 1
  106. #define GLX_BAD_ATTRIBUTE 2
  107. #define GLX_NO_EXTENSION 3
  108. #define GLX_BAD_VISUAL 4
  109. #define GLX_BAD_CONTEXT 5
  110. #define GLX_BAD_VALUE 6
  111. #define GLX_BAD_ENUM 7
  112. /*
  113. * GLX 1.1 and later:
  114. */
  115. #define GLX_VENDOR 1
  116. #define GLX_VERSION 2
  117. #define GLX_EXTENSIONS 3
  118. /*
  119. * GLX_visual_info extension
  120. */
  121. #define GLX_TRUE_COLOR_EXT 0x8002
  122. #define GLX_DIRECT_COLOR_EXT 0x8003
  123. #define GLX_PSEUDO_COLOR_EXT 0x8004
  124. #define GLX_STATIC_COLOR_EXT 0x8005
  125. #define GLX_GRAY_SCALE_EXT 0x8006
  126. #define GLX_STATIC_GRAY_EXT 0x8007
  127. #define GLX_NONE_EXT 0x8000
  128. #define GLX_TRANSPARENT_RGB_EXT 0x8008
  129. #define GLX_TRANSPARENT_INDEX_EXT 0x8009
  130. /*
  131. * Compile-time extension tests
  132. */
  133. #define GLX_EXT_visual_info 1
  134. #define GLX_MESA_pixmap_colormap 1
  135. #define GLX_MESA_release_buffers 1
  136. #define GLX_MESA_copy_sub_buffer 1
  137. #define GLX_SGI_video_sync 1
  138. #define GLX_EXT_get_proc_address 1
  139. #ifdef MESA
  140. typedef XMesaContext GLXContext;
  141. typedef Pixmap GLXPixmap;
  142. typedef Drawable GLXDrawable;
  143. #else
  144. typedef void * GLXContext;
  145. typedef XID GLXPixmap;
  146. typedef XID GLXDrawable;
  147. #endif
  148. typedef XID GLXContextID;
  149. extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
  150. int *attribList );
  151. extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
  152. GLXContext shareList, Bool direct );
  153. extern void glXDestroyContext( Display *dpy, GLXContext ctx );
  154. extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
  155. GLXContext ctx);
  156. extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
  157. GLuint mask );
  158. extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
  159. extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
  160. Pixmap pixmap );
  161. extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
  162. extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
  163. extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
  164. extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
  165. extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
  166. int attrib, int *value );
  167. extern GLXContext glXGetCurrentContext( void );
  168. extern GLXDrawable glXGetCurrentDrawable( void );
  169. extern void glXWaitGL( void );
  170. extern void glXWaitX( void );
  171. extern void glXUseXFont( Font font, int first, int count, int list );
  172. /* GLX 1.1 and later */
  173. extern const char *glXQueryExtensionsString( Display *dpy, int screen );
  174. extern const char *glXQueryServerString( Display *dpy, int screen, int name );
  175. extern const char *glXGetClientString( Display *dpy, int name );
  176. /* GLX_EXT_get_proc_address */
  177. extern GLfunction glXGetProcAddressEXT(const GLubyte *procName);
  178. /*
  179. * Mesa GLX Extensions
  180. */
  181. #ifdef GLX_MESA_pixmap_colormap
  182. extern GLXPixmap glXCreateGLXPixmapMESA( Display *dpy, XVisualInfo *visual,
  183. Pixmap pixmap, Colormap cmap );
  184. #endif
  185. #ifdef GLX_MESA_release_buffers
  186. extern Bool glXReleaseBuffersMESA( Display *dpy, GLXDrawable d );
  187. #endif
  188. #ifdef GLX_MESA_copy_sub_buffer
  189. extern void glXCopySubBufferMESA( Display *dpy, GLXDrawable drawable,
  190. int x, int y, int width, int height );
  191. #endif
  192. #ifdef GLX_SGI_video_sync
  193. extern int glXGetVideoSyncSGI(unsigned int *count);
  194. extern int glXWaitVideoSyncSGI(int divisor, int remainder,
  195. unsigned int *count);
  196. #endif
  197. #ifdef __cplusplus
  198. }
  199. #endif
  200. #endif