Merge branch 'master' into gallium-0.2
[mesa.git] / src / glx / x11 / glxclient.h
1 /*
2 * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
3 * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice including the dates of first publication and
13 * either this permission notice or a reference to
14 * http://oss.sgi.com/projects/FreeB/
15 * shall be included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
22 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 *
25 * Except as contained in this notice, the name of Silicon Graphics, Inc.
26 * shall not be used in advertising or otherwise to promote the sale, use or
27 * other dealings in this Software without prior written authorization from
28 * Silicon Graphics, Inc.
29 */
30
31 /**
32 * \file glxclient.h
33 * Direct rendering support added by Precision Insight, Inc.
34 *
35 * \author Kevin E. Martin <kevin@precisioninsight.com>
36 */
37
38 #ifndef _GLX_client_h_
39 #define _GLX_client_h_
40 #define NEED_REPLIES
41 #define NEED_EVENTS
42 #include <X11/Xproto.h>
43 #include <X11/Xlibint.h>
44 #define GLX_GLXEXT_PROTOTYPES
45 #include <GL/glx.h>
46 #include <GL/glxext.h>
47 #include <string.h>
48 #include <stdlib.h>
49 #include <stdio.h>
50 #ifdef WIN32
51 #include <stdint.h>
52 #endif
53 #include "GL/glxint.h"
54 #include "GL/glxproto.h"
55 #include "GL/internal/glcore.h"
56 #include "glapi/glapitable.h"
57 #include "glxhash.h"
58 #if defined( USE_XTHREADS )
59 # include <X11/Xthreads.h>
60 #elif defined( PTHREADS )
61 # include <pthread.h>
62 #endif
63
64 #include "glxextensions.h"
65
66
67 /* If we build the library with gcc's -fvisibility=hidden flag, we'll
68 * use the PUBLIC macro to mark functions that are to be exported.
69 *
70 * We also need to define a USED attribute, so the optimizer doesn't
71 * inline a static function that we later use in an alias. - ajax
72 */
73 #if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303
74 # define PUBLIC __attribute__((visibility("default")))
75 # define USED __attribute__((used))
76 #else
77 # define PUBLIC
78 # define USED
79 #endif
80
81
82
83 #define GLX_MAJOR_VERSION 1 /* current version numbers */
84 #define GLX_MINOR_VERSION 4
85
86 #define __GLX_MAX_TEXTURE_UNITS 32
87
88 typedef struct __GLXscreenConfigsRec __GLXscreenConfigs;
89 typedef struct __GLXcontextRec __GLXcontext;
90 typedef struct __GLXdrawableRec __GLXdrawable;
91 typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
92 typedef struct _glapi_table __GLapi;
93
94 /************************************************************************/
95
96 #ifdef GLX_DIRECT_RENDERING
97
98 #define containerOf(ptr, type, member) \
99 (type *)( (char *)ptr - offsetof(type,member) )
100
101 #include <GL/internal/dri_interface.h>
102
103
104 /**
105 * Display dependent methods. This structure is initialized during the
106 * \c driCreateDisplay call.
107 */
108 typedef struct __GLXDRIdisplayRec __GLXDRIdisplay;
109 typedef struct __GLXDRIscreenRec __GLXDRIscreen;
110 typedef struct __GLXDRIdrawableRec __GLXDRIdrawable;
111 typedef struct __GLXDRIcontextRec __GLXDRIcontext;
112
113 #include "glxextensions.h"
114
115 struct __GLXDRIdisplayRec {
116 /**
117 * Method to destroy the private DRI display data.
118 */
119 void (*destroyDisplay)(__GLXDRIdisplay *display);
120
121 __GLXDRIscreen *(*createScreen)(__GLXscreenConfigs *psc, int screen,
122 __GLXdisplayPrivate *priv);
123 };
124
125 struct __GLXDRIscreenRec {
126
127 void (*destroyScreen)(__GLXscreenConfigs *psc);
128
129 __GLXDRIcontext *(*createContext)(__GLXscreenConfigs *psc,
130 const __GLcontextModes *mode,
131 GLXContext gc,
132 GLXContext shareList, int renderType);
133
134 __GLXDRIdrawable *(*createDrawable)(__GLXscreenConfigs *psc,
135 XID drawable,
136 GLXDrawable glxDrawable,
137 const __GLcontextModes *modes);
138
139 void (*swapBuffers)(__GLXDRIdrawable *pdraw);
140 };
141
142 struct __GLXDRIcontextRec {
143 void (*destroyContext)(__GLXDRIcontext *context, __GLXscreenConfigs *psc,
144 Display *dpy);
145 Bool (*bindContext)(__GLXDRIcontext *context,
146 __GLXDRIdrawable *pdraw,
147 __GLXDRIdrawable *pread);
148
149 void (*unbindContext)(__GLXDRIcontext *context);
150 };
151
152 struct __GLXDRIdrawableRec {
153 void (*destroyDrawable)(__GLXDRIdrawable *drawable);
154
155 XID xDrawable;
156 XID drawable;
157 __GLXscreenConfigs *psc;
158 GLenum textureTarget;
159 __DRIdrawable *driDrawable;
160 };
161
162 /*
163 ** Function to create and DRI display data and initialize the display
164 ** dependent methods.
165 */
166 extern __GLXDRIdisplay *driswCreateDisplay(Display *dpy);
167 extern __GLXDRIdisplay *driCreateDisplay(Display *dpy);
168 extern __GLXDRIdisplay *dri2CreateDisplay(Display *dpy);
169
170 extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
171
172 /*
173 ** Functions to obtain driver configuration information from a direct
174 ** rendering client application
175 */
176 extern const char *glXGetScreenDriver (Display *dpy, int scrNum);
177
178 extern const char *glXGetDriverConfig (const char *driverName);
179
180 #endif
181
182 /************************************************************************/
183
184 #define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
185
186 typedef struct __GLXpixelStoreModeRec {
187 GLboolean swapEndian;
188 GLboolean lsbFirst;
189 GLuint rowLength;
190 GLuint imageHeight;
191 GLuint imageDepth;
192 GLuint skipRows;
193 GLuint skipPixels;
194 GLuint skipImages;
195 GLuint alignment;
196 } __GLXpixelStoreMode;
197
198
199 typedef struct __GLXattributeRec {
200 GLuint mask;
201
202 /**
203 * Pixel storage state. Most of the pixel store mode state is kept
204 * here and used by the client code to manage the packing and
205 * unpacking of data sent to/received from the server.
206 */
207 __GLXpixelStoreMode storePack, storeUnpack;
208
209 /**
210 * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically
211 * disabled?
212 */
213 GLboolean NoDrawArraysProtocol;
214
215 /**
216 * Vertex Array storage state. The vertex array component
217 * state is stored here and is used to manage the packing of
218 * DrawArrays data sent to the server.
219 */
220 struct array_state_vector * array_state;
221 } __GLXattribute;
222
223 typedef struct __GLXattributeMachineRec {
224 __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
225 __GLXattribute **stackPointer;
226 } __GLXattributeMachine;
227
228 /**
229 * GLX state that needs to be kept on the client. One of these records
230 * exist for each context that has been made current by this client.
231 */
232 struct __GLXcontextRec {
233 /**
234 * \name Drawing command buffer.
235 *
236 * Drawing commands are packed into this buffer before being sent as a
237 * single GLX protocol request. The buffer is sent when it overflows or
238 * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location
239 * in the buffer to be filled. \c limit is described above in the buffer
240 * slop discussion.
241 *
242 * Commands that require large amounts of data to be transfered will
243 * also use this buffer to hold a header that describes the large
244 * command.
245 *
246 * These must be the first 6 fields since they are static initialized
247 * in the dummy context in glxext.c
248 */
249 /*@{*/
250 GLubyte *buf;
251 GLubyte *pc;
252 GLubyte *limit;
253 GLubyte *bufEnd;
254 GLint bufSize;
255 /*@}*/
256
257 /**
258 * The XID of this rendering context. When the context is created a
259 * new XID is allocated. This is set to None when the context is
260 * destroyed but is still current to some thread. In this case the
261 * context will be freed on next MakeCurrent.
262 */
263 XID xid;
264
265 /**
266 * The XID of the \c shareList context.
267 */
268 XID share_xid;
269
270 /**
271 * Screen number.
272 */
273 GLint screen;
274 __GLXscreenConfigs *psc;
275
276 /**
277 * \c GL_TRUE if the context was created with ImportContext, which
278 * means the server-side context was created by another X client.
279 */
280 GLboolean imported;
281
282 /**
283 * The context tag returned by MakeCurrent when this context is made
284 * current. This tag is used to identify the context that a thread has
285 * current so that proper server context management can be done. It is
286 * used for all context specific commands (i.e., \c Render, \c RenderLarge,
287 * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old
288 * context)).
289 */
290 GLXContextTag currentContextTag;
291
292 /**
293 * \name Rendering mode
294 *
295 * The rendering mode is kept on the client as well as the server.
296 * When \c glRenderMode is called, the buffer associated with the
297 * previous rendering mode (feedback or select) is filled.
298 */
299 /*@{*/
300 GLenum renderMode;
301 GLfloat *feedbackBuf;
302 GLuint *selectBuf;
303 /*@}*/
304
305 /**
306 * This is \c GL_TRUE if the pixel unpack modes are such that an image
307 * can be unpacked from the clients memory by just copying. It may
308 * still be true that the server will have to do some work. This
309 * just promises that a straight copy will fetch the correct bytes.
310 */
311 GLboolean fastImageUnpack;
312
313 /**
314 * Fill newImage with the unpacked form of \c oldImage getting it
315 * ready for transport to the server.
316 */
317 void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
318 GLenum, const GLvoid*, GLubyte*, GLubyte*);
319
320 /**
321 * Client side attribs.
322 */
323 __GLXattributeMachine attributes;
324
325 /**
326 * Client side error code. This is set when client side gl API
327 * routines need to set an error because of a bad enumerant or
328 * running out of memory, etc.
329 */
330 GLenum error;
331
332 /**
333 * Whether this context does direct rendering.
334 */
335 Bool isDirect;
336
337 /**
338 * \c dpy of current display for this context. Will be \c NULL if not
339 * current to any display, or if this is the "dummy context".
340 */
341 Display *currentDpy;
342
343 /**
344 * The current drawable for this context. Will be None if this
345 * context is not current to any drawable. currentReadable is below.
346 */
347 GLXDrawable currentDrawable;
348
349 /**
350 * \name GL Constant Strings
351 *
352 * Constant strings that describe the server implementation
353 * These pertain to GL attributes, not to be confused with
354 * GLX versioning attributes.
355 */
356 /*@{*/
357 GLubyte *vendor;
358 GLubyte *renderer;
359 GLubyte *version;
360 GLubyte *extensions;
361 /*@}*/
362
363 /**
364 * Record the dpy this context was created on for later freeing
365 */
366 Display *createDpy;
367
368 /**
369 * Maximum small render command size. This is the smaller of 64k and
370 * the size of the above buffer.
371 */
372 GLint maxSmallRenderCommandSize;
373
374 /**
375 * Major opcode for the extension. Copied here so a lookup isn't
376 * needed.
377 */
378 GLint majorOpcode;
379
380 /**
381 * Pointer to the mode used to create this context.
382 */
383 const __GLcontextModes * mode;
384
385 #ifdef GLX_DIRECT_RENDERING
386 __GLXDRIcontext *driContext;
387 __DRIcontext *__driContext;
388 #endif
389
390 /**
391 * The current read-drawable for this context. Will be None if this
392 * context is not current to any drawable.
393 *
394 * \since Internal API version 20030606.
395 */
396 GLXDrawable currentReadable;
397
398 /**
399 * Pointer to client-state data that is private to libGL. This is only
400 * used for indirect rendering contexts.
401 *
402 * No internal API version change was made for this change. Client-side
403 * drivers should NEVER use this data or even care that it exists.
404 */
405 void * client_state_private;
406
407 /**
408 * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE.
409 */
410 int renderType;
411
412 /**
413 * \name Raw server GL version
414 *
415 * True core GL version supported by the server. This is the raw value
416 * returned by the server, and it may not reflect what is actually
417 * supported (or reported) by the client-side library.
418 */
419 /*@{*/
420 int server_major; /**< Major version number. */
421 int server_minor; /**< Minor version number. */
422 /*@}*/
423
424 char gl_extension_bits[ __GL_EXT_BYTES ];
425 };
426
427 #define __glXSetError(gc,code) \
428 if (!(gc)->error) { \
429 (gc)->error = code; \
430 }
431
432 extern void __glFreeAttributeState(__GLXcontext *);
433
434 /************************************************************************/
435
436 /**
437 * The size of the largest drawing command known to the implementation
438 * that will use the GLXRender GLX command. In this case it is
439 * \c glPolygonStipple.
440 */
441 #define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156
442
443 /**
444 * To keep the implementation fast, the code uses a "limit" pointer
445 * to determine when the drawing command buffer is too full to hold
446 * another fixed size command. This constant defines the amount of
447 * space that must always be available in the drawing command buffer
448 * at all times for the implementation to work. It is important that
449 * the number be just large enough, but not so large as to reduce the
450 * efficacy of the buffer. The "+32" is just to keep the code working
451 * in case somebody counts wrong.
452 */
453 #define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32)
454
455 /**
456 * This implementation uses a smaller threshold for switching
457 * to the RenderLarge protocol than the protcol requires so that
458 * large copies don't occur.
459 */
460 #define __GLX_RENDER_CMD_SIZE_LIMIT 4096
461
462 /**
463 * One of these records exists per screen of the display. It contains
464 * a pointer to the config data for that screen (if the screen supports GL).
465 */
466 struct __GLXscreenConfigsRec {
467 /**
468 * GLX extension string reported by the X-server.
469 */
470 const char *serverGLXexts;
471
472 /**
473 * GLX extension string to be reported to applications. This is the
474 * set of extensions that the application can actually use.
475 */
476 char *effectiveGLXexts;
477
478 #ifdef GLX_DIRECT_RENDERING
479 /**
480 * Per screen direct rendering interface functions and data.
481 */
482 __DRIscreen *__driScreen;
483 const __DRIcoreExtension *core;
484 const __DRIlegacyExtension *legacy;
485 const __DRIswrastExtension *swrast;
486 const __DRIdri2Extension *dri2;
487 __glxHashTable *drawHash;
488 Display *dpy;
489 int scr, fd;
490 void *driver;
491
492 __GLXDRIscreen *driScreen;
493
494 #ifdef __DRI_COPY_SUB_BUFFER
495 const __DRIcopySubBufferExtension *copySubBuffer;
496 #endif
497
498 #ifdef __DRI_SWAP_CONTROL
499 const __DRIswapControlExtension *swapControl;
500 #endif
501
502 #ifdef __DRI_ALLOCATE
503 const __DRIallocateExtension *allocate;
504 #endif
505
506 #ifdef __DRI_FRAME_TRACKING
507 const __DRIframeTrackingExtension *frameTracking;
508 #endif
509
510 #ifdef __DRI_MEDIA_STREAM_COUNTER
511 const __DRImediaStreamCounterExtension *msc;
512 #endif
513
514 #ifdef __DRI_TEX_BUFFER
515 const __DRItexBufferExtension *texBuffer;
516 #endif
517
518 #endif
519
520 /**
521 * Linked list of glx visuals and fbconfigs for this screen.
522 */
523 __GLcontextModes *visuals, *configs;
524
525 /**
526 * Per-screen dynamic GLX extension tracking. The \c direct_support
527 * field only contains enough bits for 64 extensions. Should libGL
528 * ever need to track more than 64 GLX extensions, we can safely grow
529 * this field. The \c __GLXscreenConfigs structure is not used outside
530 * libGL.
531 */
532 /*@{*/
533 unsigned char direct_support[8];
534 GLboolean ext_list_first_time;
535 /*@}*/
536
537 };
538
539 /**
540 * Per display private data. One of these records exists for each display
541 * that is using the OpenGL (GLX) extension.
542 */
543 struct __GLXdisplayPrivateRec {
544 /**
545 * Back pointer to the display
546 */
547 Display *dpy;
548
549 /**
550 * The \c majorOpcode is common to all connections to the same server.
551 * It is also copied into the context structure.
552 */
553 int majorOpcode;
554
555 /**
556 * \name Server Version
557 *
558 * Major and minor version returned by the server during initialization.
559 */
560 /*@{*/
561 int majorVersion, minorVersion;
562 /*@}*/
563
564 /**
565 * \name Storage for the servers GLX vendor and versions strings.
566 *
567 * These are the same for all screens on this display. These fields will
568 * be filled in on demand.
569 */
570 /*@{*/
571 const char *serverGLXvendor;
572 const char *serverGLXversion;
573 /*@}*/
574
575 /**
576 * Configurations of visuals for all screens on this display.
577 * Also, per screen data which now includes the server \c GLX_EXTENSION
578 * string.
579 */
580 __GLXscreenConfigs *screenConfigs;
581
582 #ifdef GLX_DIRECT_RENDERING
583 /**
584 * Per display direct rendering interface functions and data.
585 */
586 __GLXDRIdisplay *driswDisplay;
587 __GLXDRIdisplay *driDisplay;
588 __GLXDRIdisplay *dri2Display;
589 #endif
590 };
591
592
593 extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
594
595 extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
596 GLint totalRequests,
597 const GLvoid * data, GLint dataLen);
598
599 extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
600 const GLvoid *, GLint);
601
602 /* Initialize the GLX extension for dpy */
603 extern __GLXdisplayPrivate *__glXInitialize(Display*);
604
605 extern void __glXPreferEGL(int state);
606
607 /************************************************************************/
608
609 extern int __glXDebug;
610
611 /* This is per-thread storage in an MT environment */
612 #if defined( USE_XTHREADS ) || defined( PTHREADS )
613
614 extern void __glXSetCurrentContext(__GLXcontext *c);
615
616 # if defined( GLX_USE_TLS )
617
618 extern __thread void * __glX_tls_Context
619 __attribute__((tls_model("initial-exec")));
620
621 # define __glXGetCurrentContext() __glX_tls_Context
622
623 # else
624
625 extern __GLXcontext *__glXGetCurrentContext(void);
626
627 # endif /* defined( GLX_USE_TLS ) */
628
629 #else
630
631 extern __GLXcontext *__glXcurrentContext;
632 #define __glXGetCurrentContext() __glXcurrentContext
633 #define __glXSetCurrentContext(gc) __glXcurrentContext = gc
634
635 #endif /* defined( USE_XTHREADS ) || defined( PTHREADS ) */
636
637 extern void __glXSetCurrentContextNull(void);
638
639 extern void __glXFreeContext(__GLXcontext*);
640
641
642 /*
643 ** Global lock for all threads in this address space using the GLX
644 ** extension
645 */
646 #if defined( USE_XTHREADS )
647 extern xmutex_rec __glXmutex;
648 #define __glXLock() xmutex_lock(&__glXmutex)
649 #define __glXUnlock() xmutex_unlock(&__glXmutex)
650 #elif defined( PTHREADS )
651 extern pthread_mutex_t __glXmutex;
652 #define __glXLock() pthread_mutex_lock(&__glXmutex)
653 #define __glXUnlock() pthread_mutex_unlock(&__glXmutex)
654 #else
655 #define __glXLock()
656 #define __glXUnlock()
657 #endif
658
659 /*
660 ** Setup for a command. Initialize the extension for dpy if necessary.
661 */
662 extern CARD8 __glXSetupForCommand(Display *dpy);
663
664 /************************************************************************/
665
666 /*
667 ** Data conversion and packing support.
668 */
669
670 extern const GLuint __glXDefaultPixelStore[9];
671
672 /* Send an image to the server using RenderLarge. */
673 extern void __glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim,
674 GLint width, GLint height, GLint depth, GLenum format, GLenum type,
675 const GLvoid *src, GLubyte *pc, GLubyte *modes);
676
677 /* Return the size, in bytes, of some pixel data */
678 extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum);
679
680 /* Return the number of elements per group of a specified format*/
681 extern GLint __glElementsPerGroup(GLenum format, GLenum type);
682
683 /* Return the number of bytes per element, based on the element type (other
684 ** than GL_BITMAP).
685 */
686 extern GLint __glBytesPerElement(GLenum type);
687
688 /*
689 ** Fill the transport buffer with the data from the users buffer,
690 ** applying some of the pixel store modes (unpack modes) to the data
691 ** first. As a side effect of this call, the "modes" field is
692 ** updated to contain the modes needed by the server to decode the
693 ** sent data.
694 */
695 extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
696 GLenum, const GLvoid*, GLubyte*, GLubyte*);
697
698 /* Copy map data with a stride into a packed buffer */
699 extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *);
700 extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *);
701 extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint,
702 const GLfloat *, GLfloat *);
703 extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint,
704 const GLdouble *, GLdouble *);
705
706 /*
707 ** Empty an image out of the reply buffer into the clients memory applying
708 ** the pack modes to pack back into the clients requested format.
709 */
710 extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
711 GLenum, const GLubyte *, GLvoid *);
712
713
714 /*
715 ** Allocate and Initialize Vertex Array client state, and free.
716 */
717 extern void __glXInitVertexArrayState(__GLXcontext *);
718 extern void __glXFreeVertexArrayState(__GLXcontext *);
719
720 /*
721 ** Inform the Server of the major and minor numbers and of the client
722 ** libraries extension string.
723 */
724 extern void __glXClientInfo ( Display *dpy, int opcode );
725
726 /************************************************************************/
727
728 /*
729 ** Declarations that should be in Xlib
730 */
731 #ifdef __GL_USE_OUR_PROTOTYPES
732 extern void _XFlush(Display*);
733 extern Status _XReply(Display*, xReply*, int, Bool);
734 extern void _XRead(Display*, void*, long);
735 extern void _XSend(Display*, const void*, long);
736 #endif
737
738
739 extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
740 int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
741
742 extern char * __glXGetStringFromServer( Display * dpy, int opcode,
743 CARD32 glxCode, CARD32 for_whom, CARD32 name );
744
745 extern char *__glXstrdup(const char *str);
746
747
748 extern const char __glXGLClientVersion[];
749 extern const char __glXGLClientExtensions[];
750
751 /* Get the unadjusted system time */
752 extern int __glXGetUST( int64_t * ust );
753
754 extern GLboolean __glXGetMscRateOML(Display * dpy, GLXDrawable drawable,
755 int32_t * numerator, int32_t * denominator);
756
757 #ifdef GLX_DIRECT_RENDERING
758 GLboolean
759 __driGetMscRateOML(__DRIdrawable *draw,
760 int32_t *numerator, int32_t *denominator, void *private);
761 #endif
762
763 #endif /* !__GLX_client_h__ */