Make a couple minor corrections to gl_API.xml. Fixes the name of an
[mesa.git] / src / glx / x11 / glxclient.h
1 /*
2 ** License Applicability. Except to the extent portions of this file are
3 ** made subject to an alternative license as permitted in the SGI Free
4 ** Software License B, Version 1.1 (the "License"), the contents of this
5 ** file are subject only to the provisions of the License. You may not use
6 ** this file except in compliance with the License. You may obtain a copy
7 ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
8 ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
9 **
10 ** http://oss.sgi.com/projects/FreeB
11 **
12 ** Note that, as provided in the License, the Software is distributed on an
13 ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
14 ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
15 ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
16 ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
17 **
18 ** Original Code. The Original Code is: OpenGL Sample Implementation,
19 ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
20 ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
21 ** Copyright in any portions created by third parties is as indicated
22 ** elsewhere herein. All Rights Reserved.
23 **
24 ** Additional Notice Provisions: The application programming interfaces
25 ** established by SGI in conjunction with the Original Code are The
26 ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
27 ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
28 ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
29 ** Window System(R) (Version 1.3), released October 19, 1998. This software
30 ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
31 ** published by SGI, but has not been independently verified as being
32 ** compliant with the OpenGL(R) version 1.2.1 Specification.
33 */
34 /* $XFree86: xc/lib/GL/glx/glxclient.h,v 1.21 2004/02/09 23:46:31 alanh Exp $ */
35
36 /**
37 * \file glxclient.h
38 * Direct rendering support added by Precision Insight, Inc.
39 *
40 * \author Kevin E. Martin <kevin@precisioninsight.com>
41 */
42
43 #ifndef _GLX_client_h_
44 #define _GLX_client_h_
45 #define NEED_REPLIES
46 #define NEED_EVENTS
47 #include <X11/Xproto.h>
48 #include <X11/Xlibint.h>
49 #define GLX_GLXEXT_PROTOTYPES
50 #include <GL/glx.h>
51 #include <GL/glxext.h>
52 #include <string.h>
53 #include <stdlib.h>
54 #include <stdio.h>
55 #ifdef WIN32
56 #include <stdint.h>
57 #endif
58 #include "GL/glxint.h"
59 #include "GL/glxproto.h"
60 #include "GL/internal/glcore.h"
61 #include "glapitable.h"
62 #include "glxextensions.h"
63 #if defined( XTHREADS )
64 # include "Xthreads.h"
65 #elif defined( PTHREADS )
66 # include <pthread.h>
67 #endif
68 #ifdef GLX_BUILT_IN_XMESA
69 #include "realglx.h" /* just silences prototype warnings */
70 #endif
71
72 #define GLX_MAJOR_VERSION 1 /* current version numbers */
73 #define GLX_MINOR_VERSION 4
74
75 #define __GLX_MAX_TEXTURE_UNITS 32
76
77 typedef struct __GLXcontextRec __GLXcontext;
78 typedef struct __GLXdisplayPrivateRec __GLXdisplayPrivate;
79 typedef struct _glapi_table __GLapi;
80
81 /************************************************************************/
82
83 #ifdef GLX_DIRECT_RENDERING
84
85 #include <GL/internal/dri_interface.h>
86
87 typedef void *(*CreateScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
88 int numConfigs, __GLXvisualConfig *config);
89
90 typedef void *(*CreateNewScreenFunc)(Display *dpy, int scrn, __DRIscreen *psc,
91 const __GLcontextModes * modes, const __DRIversion * ddx_version,
92 const __DRIversion * dri_version, const __DRIversion * drm_version,
93 const __DRIframebuffer * frame_buffer, void * pSAREA,
94 int fd, int internal_api_version, __GLcontextModes ** driver_modes);
95
96
97 /**
98 * Display dependent methods. This structure is initialized during the
99 * \c driCreateDisplay call.
100 */
101 struct __DRIdisplayRec {
102 /**
103 * Method to destroy the private DRI display data.
104 */
105 void (*destroyDisplay)(Display *dpy, void *displayPrivate);
106
107 /**
108 * Methods to create the private DRI screen data and initialize the
109 * screen dependent methods.
110 * This is an array [indexed by screen number] of function pointers.
111 *
112 * \deprecated This array of function pointers has been replaced by
113 * \c __DRIdisplayRec::createNewScreen.
114 * \sa __DRIdisplayRec::createNewScreen
115 */
116 CreateScreenFunc * createScreen;
117
118 /**
119 * Opaque pointer to private per display direct rendering data.
120 * \c NULL if direct rendering is not supported on this display.
121 */
122 struct __DRIdisplayPrivateRec *private;
123
124 /**
125 * Array of pointers to methods to create and initialize the private DRI
126 * screen data.
127 *
128 * \sa __DRIdisplayRec::createScreen
129 */
130 CreateNewScreenFunc * createNewScreen;
131 };
132
133
134 /*
135 ** We keep a linked list of these structures, one per DRI device driver.
136 */
137 struct __DRIdriverRec {
138 const char *name;
139 void *handle;
140 CreateScreenFunc createScreenFunc;
141 CreateNewScreenFunc createNewScreenFunc;
142 struct __DRIdriverRec *next;
143 };
144
145 /*
146 ** Function to create and DRI display data and initialize the display
147 ** dependent methods.
148 */
149 extern void *driCreateDisplay(Display *dpy, __DRIdisplay *pdisp);
150
151 extern __DRIdriver *driGetDriver(Display *dpy, int scrNum);
152
153 extern void DRI_glXUseXFont( Font font, int first, int count, int listbase );
154
155 /*
156 ** Functions to obtain driver configuration information from a direct
157 ** rendering client application
158 */
159 extern const char *glXGetScreenDriver (Display *dpy, int scrNum);
160
161 extern const char *glXGetDriverConfig (const char *driverName);
162
163 #endif
164
165 /************************************************************************/
166
167 #define __GL_CLIENT_ATTRIB_STACK_DEPTH 16
168
169 typedef struct __GLXpixelStoreModeRec {
170 GLboolean swapEndian;
171 GLboolean lsbFirst;
172 GLuint rowLength;
173 GLuint imageHeight;
174 GLuint imageDepth;
175 GLuint skipRows;
176 GLuint skipPixels;
177 GLuint skipImages;
178 GLuint alignment;
179 } __GLXpixelStoreMode;
180
181 /* The next 3 structures are deprecated. Client state is no longer tracked
182 * using them. They only remain to maintain the layout / structure offset of
183 * __GLXcontextRec. In XFree86 5.0 they will be removed altogether.
184 */
185
186 typedef struct __GLXvertexArrayPointerStateRecDEPRECATED {
187 GLboolean enable;
188 void (*proc)(const void *);
189 const GLubyte *ptr;
190 GLsizei skip;
191 GLint size;
192 GLenum type;
193 GLsizei stride;
194 } __GLXvertexArrayPointerStateDEPRECATED;
195
196 typedef struct __GLXvertArrayStateRecDEPRECATED {
197 __GLXvertexArrayPointerStateDEPRECATED vertex;
198 __GLXvertexArrayPointerStateDEPRECATED normal;
199 __GLXvertexArrayPointerStateDEPRECATED color;
200 __GLXvertexArrayPointerStateDEPRECATED index;
201 __GLXvertexArrayPointerStateDEPRECATED texCoord[__GLX_MAX_TEXTURE_UNITS];
202 __GLXvertexArrayPointerStateDEPRECATED edgeFlag;
203 GLint maxElementsVertices;
204 GLint maxElementsIndices;
205 GLint activeTexture;
206 } __GLXvertArrayStateDEPRECATED;
207
208 typedef struct __GLXattributeRecDEPRECATED {
209 GLuint mask;
210
211 /*
212 ** Pixel storage state. Most of the pixel store mode state is kept
213 ** here and used by the client code to manage the packing and
214 ** unpacking of data sent to/received from the server.
215 */
216 __GLXpixelStoreMode storePack, storeUnpack;
217
218 /*
219 ** Vertex Array storage state. The vertex array component
220 ** state is stored here and is used to manage the packing of
221 ** DrawArrays data sent to the server.
222 */
223 __GLXvertArrayStateDEPRECATED vertArray;
224 } __GLXattributeDEPRECATED;
225
226
227 typedef struct __GLXattributeRec {
228 GLuint mask;
229
230 /**
231 * Pixel storage state. Most of the pixel store mode state is kept
232 * here and used by the client code to manage the packing and
233 * unpacking of data sent to/received from the server.
234 */
235 __GLXpixelStoreMode storePack, storeUnpack;
236
237 /**
238 * Is EXT_vertex_array / GL 1.1 DrawArrays protocol specifically
239 * disabled?
240 */
241 GLboolean NoDrawArraysProtocol;
242
243 /**
244 * Vertex Array storage state. The vertex array component
245 * state is stored here and is used to manage the packing of
246 * DrawArrays data sent to the server.
247 */
248 struct array_state_vector * array_state;
249 } __GLXattribute;
250
251 typedef struct __GLXattributeMachineRec {
252 __GLXattribute *stack[__GL_CLIENT_ATTRIB_STACK_DEPTH];
253 __GLXattribute **stackPointer;
254 } __GLXattributeMachine;
255
256 /**
257 * GLX state that needs to be kept on the client. One of these records
258 * exist for each context that has been made current by this client.
259 */
260 struct __GLXcontextRec {
261 /**
262 * \name Drawing command buffer.
263 *
264 * Drawing commands are packed into this buffer before being sent as a
265 * single GLX protocol request. The buffer is sent when it overflows or
266 * is flushed by \c __glXFlushRenderBuffer. \c pc is the next location
267 * in the buffer to be filled. \c limit is described above in the buffer
268 * slop discussion.
269 *
270 * Commands that require large amounts of data to be transfered will
271 * also use this buffer to hold a header that describes the large
272 * command.
273 *
274 * These must be the first 6 fields since they are static initialized
275 * in the dummy context in glxext.c
276 */
277 /*@{*/
278 GLubyte *buf;
279 GLubyte *pc;
280 GLubyte *limit;
281 GLubyte *bufEnd;
282 GLint bufSize;
283 /*@}*/
284
285 /**
286 * The XID of this rendering context. When the context is created a
287 * new XID is allocated. This is set to None when the context is
288 * destroyed but is still current to some thread. In this case the
289 * context will be freed on next MakeCurrent.
290 */
291 XID xid;
292
293 /**
294 * The XID of the \c shareList context.
295 */
296 XID share_xid;
297
298 /**
299 * Visual id.
300 *
301 * \deprecated
302 * This filed has been largely been replaced by the \c mode field, but
303 * the work is not quite done.
304 */
305 VisualID vid;
306
307 /**
308 * Screen number.
309 */
310 GLint screen;
311
312 /**
313 * \c GL_TRUE if the context was created with ImportContext, which
314 * means the server-side context was created by another X client.
315 */
316 GLboolean imported;
317
318 /**
319 * The context tag returned by MakeCurrent when this context is made
320 * current. This tag is used to identify the context that a thread has
321 * current so that proper server context management can be done. It is
322 * used for all context specific commands (i.e., \c Render, \c RenderLarge,
323 * \c WaitX, \c WaitGL, \c UseXFont, and \c MakeCurrent (for the old
324 * context)).
325 */
326 GLXContextTag currentContextTag;
327
328 /**
329 * \name Rendering mode
330 *
331 * The rendering mode is kept on the client as well as the server.
332 * When \c glRenderMode is called, the buffer associated with the
333 * previous rendering mode (feedback or select) is filled.
334 */
335 /*@{*/
336 GLenum renderMode;
337 GLfloat *feedbackBuf;
338 GLuint *selectBuf;
339 /*@}*/
340
341 /**
342 * This is \c GL_TRUE if the pixel unpack modes are such that an image
343 * can be unpacked from the clients memory by just copying. It may
344 * still be true that the server will have to do some work. This
345 * just promises that a straight copy will fetch the correct bytes.
346 */
347 GLboolean fastImageUnpack;
348
349 /**
350 * Fill newImage with the unpacked form of \c oldImage getting it
351 * ready for transport to the server.
352 */
353 void (*fillImage)(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
354 GLenum, const GLvoid*, GLubyte*, GLubyte*);
355
356 /**
357 * \name Client side attribs.
358 */
359 /*@{*/
360 __GLXattributeDEPRECATED stateDEPRECATED;
361 __GLXattributeMachine attributes;
362 /*@}*/
363
364 /**
365 * Client side error code. This is set when client side gl API
366 * routines need to set an error because of a bad enumerant or
367 * running out of memory, etc.
368 */
369 GLenum error;
370
371 /**
372 * Whether this context does direct rendering.
373 */
374 Bool isDirect;
375
376 /**
377 * \c dpy of current display for this context. Will be \c NULL if not
378 * current to any display, or if this is the "dummy context".
379 */
380 Display *currentDpy;
381
382 /**
383 * The current drawable for this context. Will be None if this
384 * context is not current to any drawable. currentReadable is below.
385 */
386 GLXDrawable currentDrawable;
387
388 /**
389 * \name GL Constant Strings
390 *
391 * Constant strings that describe the server implementation
392 * These pertain to GL attributes, not to be confused with
393 * GLX versioning attributes.
394 */
395 /*@{*/
396 GLubyte *vendor;
397 GLubyte *renderer;
398 GLubyte *version;
399 GLubyte *extensions;
400 /*@}*/
401
402 /**
403 * Record the dpy this context was created on for later freeing
404 */
405 Display *createDpy;
406
407 /**
408 * Maximum small render command size. This is the smaller of 64k and
409 * the size of the above buffer.
410 */
411 GLint maxSmallRenderCommandSize;
412
413 /**
414 * Major opcode for the extension. Copied here so a lookup isn't
415 * needed.
416 */
417 GLint majorOpcode;
418
419 #ifdef GLX_DIRECT_RENDERING
420 /**
421 * Per context direct rendering interface functions and data.
422 */
423 __DRIcontext driContext;
424 #endif
425
426 /**
427 * \c GLXFBConfigID used to create this context. May be \c None. This
428 * field has been replaced by the \c mode field.
429 *
430 * \since Internal API version 20030317.
431 *
432 * \deprecated
433 * This filed has been largely been replaced by the \c mode field, but
434 * the work is not quite done.
435 */
436 GLXFBConfigID fbconfigID;
437
438 /**
439 * The current read-drawable for this context. Will be None if this
440 * context is not current to any drawable.
441 *
442 * \since Internal API version 20030606.
443 */
444 GLXDrawable currentReadable;
445
446 /**
447 * Pointer to client-state data that is private to libGL. This is only
448 * used for indirect rendering contexts.
449 *
450 * No internal API version change was made for this change. Client-side
451 * drivers should NEVER use this data or even care that it exists.
452 */
453 void * client_state_private;
454
455 /**
456 * Stored value for \c glXQueryContext attribute \c GLX_RENDER_TYPE.
457 */
458 int renderType;
459
460 /**
461 * \name Raw server GL version
462 *
463 * True core GL version supported by the server. This is the raw value
464 * returned by the server, and it may not reflect what is actually
465 * supported (or reported) by the client-side library.
466 */
467 /*@{*/
468 int server_major; /**< Major version number. */
469 int server_minor; /**< Minor version number. */
470 /*@}*/
471
472 char gl_extension_bits[ __GL_EXT_BYTES ];
473 };
474
475 #define __glXSetError(gc,code) \
476 if (!(gc)->error) { \
477 (gc)->error = code; \
478 }
479
480 extern void __glFreeAttributeState(__GLXcontext *);
481
482 /************************************************************************/
483
484 /**
485 * The size of the largest drawing command known to the implementation
486 * that will use the GLXRender GLX command. In this case it is
487 * \c glPolygonStipple.
488 */
489 #define __GLX_MAX_SMALL_RENDER_CMD_SIZE 156
490
491 /**
492 * To keep the implementation fast, the code uses a "limit" pointer
493 * to determine when the drawing command buffer is too full to hold
494 * another fixed size command. This constant defines the amount of
495 * space that must always be available in the drawing command buffer
496 * at all times for the implementation to work. It is important that
497 * the number be just large enough, but not so large as to reduce the
498 * efficacy of the buffer. The "+32" is just to keep the code working
499 * in case somebody counts wrong.
500 */
501 #define __GLX_BUFFER_LIMIT_SIZE (__GLX_MAX_SMALL_RENDER_CMD_SIZE + 32)
502
503 /**
504 * This implementation uses a smaller threshold for switching
505 * to the RenderLarge protocol than the protcol requires so that
506 * large copies don't occur.
507 */
508 #define __GLX_RENDER_CMD_SIZE_LIMIT 4096
509
510 /**
511 * One of these records exists per screen of the display. It contains
512 * a pointer to the config data for that screen (if the screen supports GL).
513 */
514 typedef struct __GLXscreenConfigsRec {
515 /**
516 * GLX visuals formated as \c __GLXvisualConfig structures.
517 */
518 /*@{*/
519 __GLXvisualConfig * old_configs;
520 int numOldConfigs;
521 /*@}*/
522
523 /**
524 * GLX extension string reported by the X-server.
525 */
526 const char *serverGLXexts;
527
528 /**
529 * GLX extension string to be reported to applications. This is the
530 * set of extensions that the application can actually use.
531 */
532 char *effectiveGLXexts;
533
534 #ifdef GLX_DIRECT_RENDERING
535 /**
536 * Per screen direct rendering interface functions and data.
537 */
538 __DRIscreen driScreen;
539 #endif
540
541 /**
542 * Linked list of configurations for this screen. This is intended to
543 * be a superset of \c old_configs.
544 */
545 __GLcontextModes *configs;
546 /**
547 * Per-screen dynamic GLX extension tracking. The \c direct_support
548 * field only contains enough bits for 64 extensions. Should libGL
549 * ever need to track more than 64 GLX extensions, we can safely grow
550 * this field. The \c __GLXscreenConfigs structure is not used outside
551 * libGL.
552 */
553 /*@{*/
554 unsigned char direct_support[8];
555 GLboolean ext_list_first_time;
556 /*@}*/
557
558 } __GLXscreenConfigs;
559
560 /**
561 * Per display private data. One of these records exists for each display
562 * that is using the OpenGL (GLX) extension.
563 */
564 struct __GLXdisplayPrivateRec {
565 /**
566 * Back pointer to the display
567 */
568 Display *dpy;
569
570 /**
571 * The \c majorOpcode is common to all connections to the same server.
572 * It is also copied into the context structure.
573 */
574 int majorOpcode;
575
576 /**
577 * \name Server Version
578 *
579 * Major and minor version returned by the server during initialization.
580 */
581 /*@{*/
582 int majorVersion, minorVersion;
583 /*@}*/
584
585 /**
586 * \name Storage for the servers GLX vendor and versions strings.
587 *
588 * These are the same for all screens on this display. These fields will
589 * be filled in on demand.
590 */
591 /*@{*/
592 const char *serverGLXvendor;
593 const char *serverGLXversion;
594 /*@}*/
595
596 /**
597 * Configurations of visuals for all screens on this display.
598 * Also, per screen data which now includes the server \c GLX_EXTENSION
599 * string.
600 */
601 __GLXscreenConfigs *screenConfigs;
602
603 #ifdef GLX_DIRECT_RENDERING
604 /**
605 * Per display direct rendering interface functions and data.
606 */
607 __DRIdisplay driDisplay;
608 #endif
609 };
610
611 void __glXFreeContext(__GLXcontext*);
612
613 extern GLubyte *__glXFlushRenderBuffer(__GLXcontext*, GLubyte*);
614
615 extern void __glXSendLargeChunk(__GLXcontext *gc, GLint requestNumber,
616 GLint totalRequests,
617 const GLvoid * data, GLint dataLen);
618
619 extern void __glXSendLargeCommand(__GLXcontext *, const GLvoid *, GLint,
620 const GLvoid *, GLint);
621
622 /* Initialize the GLX extension for dpy */
623 extern __GLXdisplayPrivate *__glXInitialize(Display*);
624
625 /************************************************************************/
626
627 extern int __glXDebug;
628
629 /* This is per-thread storage in an MT environment */
630 #if defined( XTHREADS ) || defined( PTHREADS )
631
632 extern void __glXSetCurrentContext(__GLXcontext *c);
633
634 # if defined( GLX_USE_TLS )
635
636 extern __thread void * __glX_tls_Context
637 __attribute__((tls_model("initial-exec")));
638
639 # define __glXGetCurrentContext() __glX_tls_Context
640
641 # else
642
643 extern __GLXcontext *__glXGetCurrentContext(void);
644
645 # endif /* defined( GLX_USE_TLS ) */
646
647 #else
648
649 extern __GLXcontext *__glXcurrentContext;
650 #define __glXGetCurrentContext() __glXcurrentContext
651 #define __glXSetCurrentContext(gc) __glXcurrentContext = gc
652
653 #endif /* defined( XTHREADS ) || defined( PTHREADS ) */
654
655
656 /*
657 ** Global lock for all threads in this address space using the GLX
658 ** extension
659 */
660 #if defined( XTHREADS )
661 extern xmutex_rec __glXmutex;
662 #define __glXLock() xmutex_lock(&__glXmutex)
663 #define __glXUnlock() xmutex_unlock(&__glXmutex)
664 #elif defined( PTHREADS )
665 extern pthread_mutex_t __glXmutex;
666 #define __glXLock() pthread_mutex_lock(&__glXmutex)
667 #define __glXUnlock() pthread_mutex_unlock(&__glXmutex)
668 #else
669 #define __glXLock()
670 #define __glXUnlock()
671 #endif
672
673 /*
674 ** Setup for a command. Initialize the extension for dpy if necessary.
675 */
676 extern CARD8 __glXSetupForCommand(Display *dpy);
677
678 /************************************************************************/
679
680 /*
681 ** Data conversion and packing support.
682 */
683
684 extern const GLuint __glXDefaultPixelStore[9];
685
686 /* Send an image to the server using RenderLarge. */
687 extern void __glXSendLargeImage(__GLXcontext *gc, GLint compsize, GLint dim,
688 GLint width, GLint height, GLint depth, GLenum format, GLenum type,
689 const GLvoid *src, GLubyte *pc, GLubyte *modes);
690
691 /* Return the size, in bytes, of some pixel data */
692 extern GLint __glImageSize(GLint, GLint, GLint, GLenum, GLenum, GLenum);
693
694 /* Return the number of elements per group of a specified format*/
695 extern GLint __glElementsPerGroup(GLenum format, GLenum type);
696
697 /* Return the number of bytes per element, based on the element type (other
698 ** than GL_BITMAP).
699 */
700 extern GLint __glBytesPerElement(GLenum type);
701
702 /*
703 ** Fill the transport buffer with the data from the users buffer,
704 ** applying some of the pixel store modes (unpack modes) to the data
705 ** first. As a side effect of this call, the "modes" field is
706 ** updated to contain the modes needed by the server to decode the
707 ** sent data.
708 */
709 extern void __glFillImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
710 GLenum, const GLvoid*, GLubyte*, GLubyte*);
711
712 /* Copy map data with a stride into a packed buffer */
713 extern void __glFillMap1f(GLint, GLint, GLint, const GLfloat *, GLubyte *);
714 extern void __glFillMap1d(GLint, GLint, GLint, const GLdouble *, GLubyte *);
715 extern void __glFillMap2f(GLint, GLint, GLint, GLint, GLint,
716 const GLfloat *, GLfloat *);
717 extern void __glFillMap2d(GLint, GLint, GLint, GLint, GLint,
718 const GLdouble *, GLdouble *);
719
720 /*
721 ** Empty an image out of the reply buffer into the clients memory applying
722 ** the pack modes to pack back into the clients requested format.
723 */
724 extern void __glEmptyImage(__GLXcontext*, GLint, GLint, GLint, GLint, GLenum,
725 GLenum, const GLubyte *, GLvoid *);
726
727
728 /*
729 ** Allocate and Initialize Vertex Array client state
730 */
731 extern void __glXInitVertexArrayState(__GLXcontext*);
732
733 /*
734 ** Inform the Server of the major and minor numbers and of the client
735 ** libraries extension string.
736 */
737 extern void __glXClientInfo ( Display *dpy, int opcode );
738
739 /************************************************************************/
740
741 /*
742 ** Declarations that should be in Xlib
743 */
744 #ifdef __GL_USE_OUR_PROTOTYPES
745 extern void _XFlush(Display*);
746 extern Status _XReply(Display*, xReply*, int, Bool);
747 extern void _XRead(Display*, void*, long);
748 extern void _XSend(Display*, const void*, long);
749 #endif
750
751
752 /*
753 ** GLX_BUILT_IN_XMESA controls whether libGL has a built-in verions of
754 ** Mesa that can render to non-GLX displays.
755 */
756 #ifdef GLX_BUILT_IN_XMESA
757 #define GLX_PREFIX(function) _real_##function
758 #else
759 #define GLX_PREFIX(function) function
760 #endif
761
762
763 extern void __glXInitializeVisualConfigFromTags( __GLcontextModes *config,
764 int count, const INT32 *bp, Bool tagged_only, Bool fbconfig_style_tags );
765
766 extern char * __glXGetStringFromServer( Display * dpy, int opcode,
767 CARD32 glxCode, CARD32 for_whom, CARD32 name );
768
769 extern char *__glXstrdup(const char *str);
770
771
772 extern const char __glXGLClientVersion[];
773 extern const char __glXGLClientExtensions[];
774
775 /* Determine the internal API version */
776 extern int __glXGetInternalVersion(void);
777
778 /* Get the unadjusted system time */
779 extern int __glXGetUST( int64_t * ust );
780
781 #endif /* !__GLX_client_h__ */