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.

xmesaP.h 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. /* $Id: xmesaP.h,v 1.13 2000/09/26 20:54:13 brianp 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 XMESAP_H
  26. #define XMESAP_H
  27. #ifdef XFree86Server
  28. # include "GL/xf86glx.h"
  29. # include "xf86glx_util.h"
  30. #else
  31. # ifdef GLX_DIRECT_RENDERING
  32. # include "dri_mesa.h"
  33. # endif
  34. # ifdef USE_XSHM
  35. # include <X11/extensions/XShm.h>
  36. # endif
  37. #endif
  38. #include "GL/xmesa.h"
  39. #include "types.h"
  40. #if defined(FX) && !defined(GLX_DIRECT_RENDERING)
  41. #include "GL/fxmesa.h"
  42. #include "../FX/fxdrv.h"
  43. #endif
  44. #if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
  45. # include "xdriP.h"
  46. #else
  47. # define DRI_DRAWABLE_ARG
  48. # define DRI_DRAWABLE_PARM
  49. # define DRI_CTX_ARG
  50. #endif
  51. extern _glthread_Mutex _xmesa_lock;
  52. /* for PF_8R8G8B24 pixel format */
  53. typedef struct {
  54. GLubyte b;
  55. GLubyte g;
  56. GLubyte r;
  57. } bgr_t;
  58. /* Function pointer for clearing color buffers */
  59. typedef void (*clear_func)( GLcontext *ctx,
  60. GLboolean all, GLint x, GLint y,
  61. GLint width, GLint height );
  62. /*
  63. * "Derived" from gl_visual. Basically corresponds to an XVisualInfo.
  64. */
  65. struct xmesa_visual {
  66. GLvisual *gl_visual; /* Device independent visual parameters */
  67. XMesaDisplay *display; /* The X11 display */
  68. #ifdef XFree86Server
  69. GLint screen_depth; /* The depth of the screen */
  70. #else
  71. XVisualInfo *vishandle; /* The pointer returned by glXChooseVisual */
  72. #endif
  73. XMesaVisualInfo visinfo; /* X's visual info */
  74. GLint BitsPerPixel; /* True bits per pixel for XImages */
  75. GLint level; /* 0=normal, 1=overlay, etc */
  76. GLint VisualCaveat; /* for GLX_EXT_visual_rating extension */
  77. GLboolean ximage_flag; /* Use XImage for back buffer (not pixmap)? */
  78. GLuint dithered_pf; /* Pixel format when dithering */
  79. GLuint undithered_pf; /* Pixel format when not dithering */
  80. GLfloat RedGamma; /* Gamma values, 1.0 is default */
  81. GLfloat GreenGamma;
  82. GLfloat BlueGamma;
  83. GLint rmult, gmult, bmult; /* Range of color values */
  84. GLint index_bits; /* Bits per pixel in CI mode */
  85. /* For PF_TRUECOLOR */
  86. GLint rshift, gshift, bshift;/* Pixel color component shifts */
  87. GLubyte Kernel[16]; /* Dither kernel */
  88. unsigned long RtoPixel[512]; /* RGB to pixel conversion */
  89. unsigned long GtoPixel[512];
  90. unsigned long BtoPixel[512];
  91. GLubyte PixelToR[256]; /* Pixel to RGB conversion */
  92. GLubyte PixelToG[256];
  93. GLubyte PixelToB[256];
  94. /* For PF_HPCR */
  95. short hpcr_rgbTbl[3][256];
  96. GLboolean hpcr_clear_flag;
  97. GLubyte hpcr_clear_ximage_pattern[2][16];
  98. XMesaImage *hpcr_clear_ximage;
  99. XMesaPixmap hpcr_clear_pixmap;
  100. /* For PF_1BIT */
  101. int bitFlip;
  102. };
  103. /*
  104. * "Derived" from __GLcontextRec. Basically corresponds to a GLXContext.
  105. */
  106. struct xmesa_context {
  107. GLcontext *gl_ctx; /* the core library context */
  108. XMesaVisual xm_visual; /* Describes the buffers */
  109. XMesaBuffer xm_buffer; /* current draw framebuffer */
  110. XMesaBuffer xm_read_buffer; /* current read framebuffer */
  111. GLboolean use_read_buffer; /* read from the xm_read_buffer/ */
  112. XMesaDisplay *display; /* == xm_visual->display */
  113. GLboolean swapbytes; /* Host byte order != display byte order? */
  114. GLboolean direct; /* Direct rendering context? */
  115. GLuint pixelformat; /* Current pixel format */
  116. GLubyte red, green, blue, alpha; /* current drawing color */
  117. unsigned long pixel; /* current drawing pixel value */
  118. GLubyte clearcolor[4]; /* current clearing color */
  119. unsigned long clearpixel; /* current clearing pixel value */
  120. #if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
  121. __DRIcontextPrivate *driContextPriv; /* back pointer to DRI context
  122. * used for locking
  123. */
  124. void *private; /* device-specific private context */
  125. #endif
  126. };
  127. /*
  128. * "Derived" from gl_buffer. Basically corresponds to a GLXDrawable.
  129. */
  130. struct xmesa_buffer {
  131. GLboolean wasCurrent; /* was ever the current buffer? */
  132. GLframebuffer *gl_buffer; /* depth, stencil, accum, etc buffers */
  133. XMesaVisual xm_visual; /* the X/Mesa visual */
  134. XMesaContext xm_context; /* the context associated with this buffer */
  135. XMesaDisplay *display;
  136. GLboolean pixmap_flag; /* is the buffer a Pixmap? */
  137. XMesaDrawable frontbuffer; /* either a window or pixmap */
  138. XMesaPixmap backpixmap; /* back buffer Pixmap */
  139. XMesaImage *backimage; /* back buffer simulated XImage */
  140. XMesaDrawable buffer; /* the current buffer, either equal to */
  141. /* frontbuffer, backpixmap or XIMAGE (None) */
  142. XMesaColormap cmap; /* the X colormap */
  143. GLint db_state; /* 0 = single buffered */
  144. /* BACK_PIXMAP = use Pixmap for back buffer */
  145. /* BACK_XIMAGE = use XImage for back buffer */
  146. #ifndef XFree86Server
  147. GLuint shm; /* X Shared Memory extension status: */
  148. /* 0 = not available */
  149. /* 1 = XImage support available */
  150. /* 2 = Pixmap support available too */
  151. #ifdef USE_XSHM
  152. XShmSegmentInfo shminfo;
  153. #endif
  154. #endif
  155. XMesaImage *rowimage; /* Used for optimized span writing */
  156. GLuint width, height; /* size of buffer */
  157. GLint bottom; /* used for FLIP macro below */
  158. GLubyte *ximage_origin1; /* used for PIXELADDR1 macro */
  159. GLint ximage_width1;
  160. GLushort *ximage_origin2; /* used for PIXELADDR2 macro */
  161. GLint ximage_width2;
  162. GLubyte *ximage_origin3; /* used for PIXELADDR3 macro */
  163. GLint ximage_width3;
  164. GLuint *ximage_origin4; /* used for PIXELADDR4 macro */
  165. GLint ximage_width4;
  166. XMesaPixmap stipple_pixmap; /* For polygon stippling */
  167. XMesaGC stipple_gc; /* For polygon stippling */
  168. XMesaGC gc1; /* GC for infrequent color changes */
  169. XMesaGC gc2; /* GC for frequent color changes */
  170. XMesaGC cleargc; /* GC for clearing the color buffer */
  171. /* The following are here instead of in the XMesaVisual
  172. * because they depend on the window's colormap.
  173. */
  174. /* For PF_DITHER, PF_LOOKUP, PF_GRAYSCALE */
  175. unsigned long color_table[576]; /* RGB -> pixel value */
  176. /* For PF_DITHER, PF_LOOKUP, PF_GRAYSCALE */
  177. GLubyte pixel_to_r[65536]; /* pixel value -> red */
  178. GLubyte pixel_to_g[65536]; /* pixel value -> green */
  179. GLubyte pixel_to_b[65536]; /* pixel value -> blue */
  180. /* Used to do XAllocColor/XFreeColors accounting: */
  181. int num_alloced;
  182. unsigned long alloced_colors[256];
  183. #if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server)
  184. __DRIdrawablePrivate *driDrawPriv; /* back pointer to DRI drawable
  185. * used for direct access to framebuffer
  186. */
  187. void *private; /* device-specific private drawable */
  188. #endif
  189. #if defined( FX ) && !defined(GLX_DIRECT_RENDERING)
  190. /* For 3Dfx Glide only */
  191. GLboolean FXisHackUsable; /* Can we render into window? */
  192. GLboolean FXwindowHack; /* Are we rendering into a window? */
  193. fxMesaContext FXctx;
  194. #endif
  195. /* functions for clearing the front and back color buffers */
  196. clear_func front_clear_func;
  197. clear_func back_clear_func;
  198. struct xmesa_buffer *Next; /* Linked list pointer: */
  199. };
  200. /* Values for xmesa->dest: */
  201. #define FRONT_PIXMAP 1
  202. #define BACK_PIXMAP 2
  203. #define BACK_XIMAGE 4
  204. /* Values for xmesa->pixelformat: */
  205. #define PF_INDEX 1 /* Color Index mode */
  206. #define PF_TRUECOLOR 2 /* TrueColor or DirectColor, any depth */
  207. #define PF_TRUEDITHER 3 /* TrueColor with dithering */
  208. #define PF_8A8B8G8R 4 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
  209. #define PF_8R8G8B 5 /* 32-bit TrueColor: 8-R, 8-G, 8-B bits */
  210. #define PF_5R6G5B 6 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
  211. #define PF_DITHER 7 /* Color-mapped RGB with dither */
  212. #define PF_LOOKUP 8 /* Color-mapped RGB without dither */
  213. #define PF_HPCR 9 /* HP Color Recovery (ad@lms.be 30/08/95) */
  214. #define PF_1BIT 10 /* monochrome dithering of RGB */
  215. #define PF_GRAYSCALE 11 /* Grayscale or StaticGray */
  216. #define PF_8R8G8B24 12 /* 24-bit TrueColor: 8-R, 8-G, 8-B bits */
  217. #define PF_DITHER_5R6G5B 13 /* 16-bit dithered TrueColor: 5-R, 6-G, 5-B */
  218. /*
  219. * If pixelformat==PF_TRUECOLOR:
  220. */
  221. #define PACK_TRUECOLOR( PIXEL, R, G, B ) \
  222. PIXEL = xmesa->xm_visual->RtoPixel[R] \
  223. | xmesa->xm_visual->GtoPixel[G] \
  224. | xmesa->xm_visual->BtoPixel[B]; \
  225. /*
  226. * If pixelformat==PF_TRUEDITHER:
  227. */
  228. #define PACK_TRUEDITHER( PIXEL, X, Y, R, G, B ) \
  229. { \
  230. int d = xmesa->xm_visual->Kernel[((X)&3) | (((Y)&3)<<2)]; \
  231. PIXEL = xmesa->xm_visual->RtoPixel[(R)+d] \
  232. | xmesa->xm_visual->GtoPixel[(G)+d] \
  233. | xmesa->xm_visual->BtoPixel[(B)+d]; \
  234. }
  235. /*
  236. * If pixelformat==PF_8A8B8G8R:
  237. */
  238. #define PACK_8A8B8G8R( R, G, B, A ) \
  239. ( ((A) << 24) | ((B) << 16) | ((G) << 8) | (R) )
  240. /*
  241. * Like PACK_8A8B8G8R() but don't use alpha. This is usually an acceptable
  242. * shortcut.
  243. */
  244. #define PACK_8B8G8R( R, G, B ) ( ((B) << 16) | ((G) << 8) | (R) )
  245. /*
  246. * If pixelformat==PF_8R8G8B:
  247. */
  248. #define PACK_8R8G8B( R, G, B) ( ((R) << 16) | ((G) << 8) | (B) )
  249. /*
  250. * If pixelformat==PF_5R6G5B:
  251. */
  252. #define PACK_5R6G5B( R, G, B) ( (((R) & 0xf8) << 8) | (((G) & 0xfc) << 3) | ((B) >> 3) )
  253. /*
  254. * If pixelformat==PF_DITHER:
  255. *
  256. * Improved 8-bit RGB dithering code contributed by Bob Mercier
  257. * (mercier@hollywood.cinenet.net). Thanks Bob!
  258. */
  259. #undef _R
  260. #undef _G
  261. #undef _B
  262. #undef _D
  263. #ifdef DITHER666
  264. # define _R 6
  265. # define _G 6
  266. # define _B 6
  267. # define _MIX(r,g,b) (((r)*_G+(g))*_B+(b))
  268. #else
  269. # define _R 5
  270. # define _G 9
  271. # define _B 5
  272. # define _MIX(r,g,b) ( ((g)<<6) | ((b)<<3) | (r) )
  273. #endif
  274. #define _DX 4
  275. #define _DY 4
  276. #define _D (_DX*_DY)
  277. /*#define _DITH(C,c,d) (((unsigned)((_D*(C-1)+1)*c+d))/(_D*256))*/
  278. #define _DITH(C,c,d) (((unsigned)((_D*(C-1)+1)*c+d)) >> 12)
  279. #define MAXC 256
  280. static int kernel8[_DY*_DX] = {
  281. 0 * MAXC, 8 * MAXC, 2 * MAXC, 10 * MAXC,
  282. 12 * MAXC, 4 * MAXC, 14 * MAXC, 6 * MAXC,
  283. 3 * MAXC, 11 * MAXC, 1 * MAXC, 9 * MAXC,
  284. 15 * MAXC, 7 * MAXC, 13 * MAXC, 5 * MAXC,
  285. };
  286. /*static int __d;*/
  287. /* Dither for random X,Y */
  288. #define DITHER_SETUP \
  289. int __d; \
  290. unsigned long *ctable = xmesa->xm_buffer->color_table;
  291. #define DITHER( X, Y, R, G, B ) \
  292. (__d = kernel8[(((Y)&3)<<2) | ((X)&3)], \
  293. ctable[_MIX(_DITH(_R, (R), __d), \
  294. _DITH(_G, (G), __d), \
  295. _DITH(_B, (B), __d))])
  296. /* Dither for random X, fixed Y */
  297. #define XDITHER_SETUP(Y) \
  298. int __d; \
  299. unsigned long *ctable = xmesa->xm_buffer->color_table; \
  300. int *kernel = &kernel8[ ((Y)&3) << 2 ];
  301. #define XDITHER( X, R, G, B ) \
  302. (__d = kernel[(X)&3], \
  303. ctable[_MIX(_DITH(_R, (R), __d), \
  304. _DITH(_G, (G), __d), \
  305. _DITH(_B, (B), __d))])
  306. /*
  307. * Dithering for flat-shaded triangles. Precompute all 16 possible
  308. * pixel values given the triangle's RGB color. Contributed by Martin Shenk.
  309. */
  310. static GLushort DitherValues[16]; /* array of (up to) 16-bit pixel values */
  311. #define FLAT_DITHER_SETUP( R, G, B ) \
  312. { \
  313. unsigned long *ctable = xmesa->xm_buffer->color_table; \
  314. int msdr = (_D*((_R)-1)+1) * (R); \
  315. int msdg = (_D*((_G)-1)+1) * (G); \
  316. int msdb = (_D*((_B)-1)+1) * (B); \
  317. int i; \
  318. for (i=0;i<16;i++) { \
  319. int k = kernel8[i]; \
  320. int j = _MIX( (msdr+k)>>12, (msdg+k)>>12, (msdb+k)>>12 ); \
  321. DitherValues[i] = (GLushort) ctable[j]; \
  322. } \
  323. }
  324. #define FLAT_DITHER_ROW_SETUP(Y) \
  325. GLushort *ditherRow = DitherValues + ( ((Y)&3) << 2);
  326. #define FLAT_DITHER(X) ditherRow[(X)&3]
  327. /*
  328. * If pixelformat==PF_LOOKUP:
  329. */
  330. #define _DITH0(C,c) (((unsigned)((_D*(C-1)+1)*c)) >> 12)
  331. #define LOOKUP_SETUP \
  332. unsigned long *ctable = xmesa->xm_buffer->color_table
  333. #define LOOKUP( R, G, B ) \
  334. ctable[_MIX(_DITH0(_R, (R)), \
  335. _DITH0(_G, (G)), \
  336. _DITH0(_B, (B)))]
  337. /*
  338. * If pixelformat==PF_HPCR:
  339. *
  340. * HP Color Recovery dithering (ad@lms.be 30/08/95)
  341. * HP has on it's 8-bit 700-series computers, a feature called
  342. * 'Color Recovery'. This allows near 24-bit output (so they say).
  343. * It is enabled by selecting the 8-bit TrueColor visual AND
  344. * corresponding colormap (see tkInitWindow) AND doing some special
  345. * dither.
  346. */
  347. static const short HPCR_DRGB[3][2][16] = {
  348. {
  349. { 16, -4, 1,-11, 14, -6, 3, -9, 15, -5, 2,-10, 13, -7, 4, -8},
  350. {-15, 5, 0, 12,-13, 7, -2, 10,-14, 6, -1, 11,-12, 8, -3, 9}
  351. },
  352. {
  353. {-11, 15, -7, 3, -8, 14, -4, 2,-10, 16, -6, 4, -9, 13, -5, 1},
  354. { 12,-14, 8, -2, 9,-13, 5, -1, 11,-15, 7, -3, 10,-12, 6, 0}
  355. },
  356. {
  357. { 6,-18, 26,-14, 2,-22, 30,-10, 8,-16, 28,-12, 4,-20, 32, -8},
  358. { -4, 20,-24, 16, 0, 24,-28, 12, -6, 18,-26, 14, -2, 22,-30, 10}
  359. }
  360. };
  361. #define DITHER_HPCR( X, Y, R, G, B ) \
  362. ( ((xmesa->xm_visual->hpcr_rgbTbl[0][R] + HPCR_DRGB[0][(Y)&1][(X)&15]) & 0xE0) \
  363. |(((xmesa->xm_visual->hpcr_rgbTbl[1][G] + HPCR_DRGB[1][(Y)&1][(X)&15]) & 0xE0)>>3) \
  364. | ((xmesa->xm_visual->hpcr_rgbTbl[2][B] + HPCR_DRGB[2][(Y)&1][(X)&15])>>6) \
  365. )
  366. /*
  367. * If pixelformat==PF_1BIT:
  368. */
  369. static int const kernel1[16] = {
  370. 0*47, 9*47, 4*47, 12*47, /* 47 = (255*3)/16 */
  371. 6*47, 2*47, 14*47, 8*47,
  372. 10*47, 1*47, 5*47, 11*47,
  373. 7*47, 13*47, 3*47, 15*47 };
  374. #define SETUP_1BIT int bitFlip = xmesa->xm_visual->bitFlip
  375. #define DITHER_1BIT( X, Y, R, G, B ) \
  376. (( ((int)(R)+(int)(G)+(int)(B)) > kernel1[(((Y)&3) << 2) | ((X)&3)] ) ^ bitFlip)
  377. /*
  378. * If pixelformat==PF_GRAYSCALE:
  379. */
  380. #define GRAY_RGB( R, G, B ) xmesa->xm_buffer->color_table[((R) + (G) + (B))/3]
  381. #define XIMAGE None
  382. /*
  383. * Converts a GL window Y coord to an X window Y coord:
  384. */
  385. #define FLIP(BUFFER, Y) ((BUFFER)->bottom-(Y))
  386. /*
  387. * Return the address of a 1, 2 or 4-byte pixel in the back XImage:
  388. * X==0 is left, Y==0 is bottom.
  389. */
  390. #define PIXELADDR1( BUFFER, X, Y ) \
  391. ( (BUFFER)->ximage_origin1 - (Y) * (BUFFER)->ximage_width1 + (X) )
  392. #define PIXELADDR2( BUFFER, X, Y ) \
  393. ( (BUFFER)->ximage_origin2 - (Y) * (BUFFER)->ximage_width2 + (X) )
  394. #define PIXELADDR3( BUFFER, X, Y ) \
  395. ( (bgr_t *) ( (BUFFER)->ximage_origin3 - (Y) * (BUFFER)->ximage_width3 + 3 * (X) ))
  396. #define PIXELADDR4( BUFFER, X, Y ) \
  397. ( (BUFFER)->ximage_origin4 - (Y) * (BUFFER)->ximage_width4 + (X) )
  398. /*
  399. * External functions:
  400. */
  401. extern unsigned long
  402. xmesa_color_to_pixel( XMesaContext xmesa,
  403. GLubyte r, GLubyte g, GLubyte b, GLubyte a,
  404. GLuint pixelFormat );
  405. extern void xmesa_alloc_back_buffer( XMesaBuffer b );
  406. extern void xmesa_update_state( GLcontext *ctx );
  407. extern points_func xmesa_get_points_func( GLcontext *ctx );
  408. extern line_func xmesa_get_line_func( GLcontext *ctx );
  409. extern triangle_func xmesa_get_triangle_func( GLcontext *ctx );
  410. extern void xmesa_update_span_funcs( GLcontext *ctx );
  411. /* XXX this is a hack to implement shared display lists with 3Dfx */
  412. extern XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v,
  413. XMesaWindow w,
  414. XMesaContext c
  415. DRI_DRAWABLE_ARG
  416. );
  417. /*
  418. * These are the extra routines required for integration with XFree86.
  419. * None of these routines should be user visible. -KEM
  420. */
  421. extern void XMesaSetVisualDisplay( XMesaDisplay *dpy, XMesaVisual v );
  422. extern GLboolean XMesaForceCurrent(XMesaContext c);
  423. extern GLboolean XMesaLoseCurrent(XMesaContext c);
  424. extern void XMesaReset( void );
  425. #endif