64102c45bf88c57c97e725eed925a65ad33d1ccc
1 /* $Id: glxapi.h,v 1.3 2000/02/25 17:04:42 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35 #define _GLXAPI_VERSION_1_1 1
36 #define _GLXAPI_VERSION_1_2 1
37 #define _GLXAPI_VERSION_1_3 1
39 #define _GLXAPI_EXT_import_context 1
40 #define _GLXAPI_SGI_video_sync 1
41 #define _GLXAPI_MESA_copy_sub_buffer 1
42 #define _GLXAPI_MESA_release_buffers 1
43 #define _GLXAPI_MESA_pixmap_colormap 1
44 #define _GLXAPI_MESA_set_3dfx_mode 1
48 * Almost all the GLX API functions get routed through this dispatch table.
49 * The exceptions are the glXGetCurrentXXX() functions.
51 * This dispatch table allows multiple GLX client-side modules to coexist.
52 * Specifically, a real GLX library (like SGI's or the Utah GLX) and Mesa's
53 * pseudo-GLX can be present at the same time. The former being used on
54 * GLX-enabled X servers and the later on non-GLX X servers.
56 struct _glxapi_table
{
57 /* GLX 1.0 functions */
58 XVisualInfo
*(*ChooseVisual
)(Display
*dpy
, int screen
, int *list
);
59 void (*CopyContext
)(Display
*dpy
, GLXContext src
, GLXContext dst
, GLuint mask
);
60 GLXContext (*CreateContext
)(Display
*dpy
, XVisualInfo
*visinfo
, GLXContext shareList
, Bool direct
);
61 GLXPixmap (*CreateGLXPixmap
)(Display
*dpy
, XVisualInfo
*visinfo
, Pixmap pixmap
);
62 void (*DestroyContext
)(Display
*dpy
, GLXContext ctx
);
63 void (*DestroyGLXPixmap
)(Display
*dpy
, GLXPixmap pixmap
);
64 int (*GetConfig
)(Display
*dpy
, XVisualInfo
*visinfo
, int attrib
, int *value
);
65 /*GLXContext (*GetCurrentContext)(void);*/
66 /*GLXDrawable (*GetCurrentDrawable)(void);*/
67 Bool (*IsDirect
)(Display
*dpy
, GLXContext ctx
);
68 Bool (*MakeCurrent
)(Display
*dpy
, GLXDrawable drawable
, GLXContext ctx
);
69 Bool (*QueryExtension
)(Display
*dpy
, int *errorb
, int *event
);
70 Bool (*QueryVersion
)(Display
*dpy
, int *maj
, int *min
);
71 void (*SwapBuffers
)(Display
*dpy
, GLXDrawable drawable
);
72 void (*UseXFont
)(Font font
, int first
, int count
, int listBase
);
76 #ifdef _GLXAPI_VERSION_1_1
77 const char *(*GetClientString
)(Display
*dpy
, int name
);
78 const char *(*QueryExtensionsString
)(Display
*dpy
, int screen
);
79 const char *(*QueryServerString
)(Display
*dpy
, int screen
, int name
);
82 #ifdef _GLXAPI_VERSION_1_2
83 /*Display *(*GetCurrentDisplay)(void);*/
86 #ifdef _GLXAPI_VERSION_1_3
87 GLXFBConfig (*ChooseFBConfig
)(Display
*dpy
, int screen
, const int *attribList
, int *nitems
);
88 GLXContext (*CreateNewContext
)(Display
*dpy
, GLXFBConfig config
, int renderType
, GLXContext shareList
, Bool direct
);
89 GLXPbuffer (*CreatePbuffer
)(Display
*dpy
, GLXFBConfig config
, const int *attribList
);
90 GLXPixmap (*CreatePixmap
)(Display
*dpy
, GLXFBConfig config
, Pixmap pixmap
, const int *attribList
);
91 GLXWindow (*CreateWindow
)(Display
*dpy
, GLXFBConfig config
, Window win
, const int *attribList
);
92 void (*DestroyPbuffer
)(Display
*dpy
, GLXPbuffer pbuf
);
93 void (*DestroyPixmap
)(Display
*dpy
, GLXPixmap pixmap
);
94 void (*DestroyWindow
)(Display
*dpy
, GLXWindow window
);
95 /*GLXDrawable (*GetCurrentReadDrawable)(void);*/
96 int (*GetFBConfigAttrib
)(Display
*dpy
, GLXFBConfig config
, int attribute
, int *value
);
97 void (*GetSelectedEvent
)(Display
*dpy
, GLXDrawable drawable
, unsigned long *mask
);
98 XVisualInfo
*(*GetVisualFromFBConfig
)(Display
*dpy
, GLXFBConfig config
);
99 Bool (*MakeContextCurrent
)(Display
*dpy
, GLXDrawable draw
, GLXDrawable read
, GLXContext ctx
);
100 int (*QueryContext
)(Display
*dpy
, GLXContext ctx
, int attribute
, int *value
);
101 void (*QueryDrawable
)(Display
*dpy
, GLXDrawable draw
, int attribute
, unsigned int *value
);
102 void (*SelectEvent
)(Display
*dpy
, GLXDrawable drawable
, unsigned long mask
);
105 #ifdef _GLXAPI_EXT_import_context
106 void (*FreeContextEXT
)(Display
*dpy
, GLXContext context
);
107 GLXContextID (*GetContextIDEXT
)(const GLXContext context
);
108 Display
*(*GetCurrentDisplayEXT
)(void);
109 GLXContext (*ImportContextEXT
)(Display
*dpy
, GLXContextID contextID
);
110 int (*QueryContextInfoEXT
)(Display
*dpy
, GLXContext context
, int attribute
,int *value
);
113 #ifdef _GLXAPI_SGI_video_sync
114 int (*GetVideoSyncSGI
)(unsigned int *count
);
115 int (*WaitVideoSyncSGI
)(int divisor
, int remainder
, unsigned int *count
);
119 * XXX thesa Mesa-specific functions might not belong here
122 #ifdef _GLXAPI_MESA_copy_sub_buffer
123 void (*CopySubBufferMESA
)(Display
*dpy
, GLXDrawable drawable
, int x
, int y
, int width
, int height
);
126 #ifdef _GLXAPI_MESA_release_buffers
127 Bool (*ReleaseBuffersMESA
)(Display
*dpy
, Window w
);
130 #ifdef _GLXAPI_MESA_pixmap_colormap
131 GLXPixmap (*CreateGLXPixmapMESA
)(Display
*dpy
, XVisualInfo
*visinfo
, Pixmap pixmap
, Colormap cmap
);
134 #ifdef _GLXAPI_MESA_set_3dfx_mode
135 GLboolean (*Set3DfxModeMESA
)(GLint mode
);
143 _glxapi_get_version(void);
147 _glxapi_get_extensions(void);
151 _glxapi_get_dispatch_table_size(void);
155 _glxapi_set_no_op_table(struct _glxapi_table
*t
);
158 extern const GLvoid
*
159 _glxapi_get_proc_address(const char *funcName
);