1 | /* Copyright (c) 2001, Stanford University
|
---|
2 | * All rights reserved.
|
---|
3 | *
|
---|
4 | * See the file LICENSE.txt for information on redistributing this software.
|
---|
5 | */
|
---|
6 | #ifndef CR_SPU_H
|
---|
7 | #define CR_SPU_H
|
---|
8 |
|
---|
9 | #ifdef WINDOWS
|
---|
10 | #define SPULOAD_APIENTRY __stdcall
|
---|
11 | #else
|
---|
12 | #define SPULOAD_APIENTRY
|
---|
13 | #endif
|
---|
14 |
|
---|
15 | #include "cr_dll.h"
|
---|
16 | #include "spu_dispatch_table.h"
|
---|
17 | #include "cr_net.h"
|
---|
18 |
|
---|
19 | #include <iprt/types.h>
|
---|
20 |
|
---|
21 | #ifdef DARWIN
|
---|
22 | # include <OpenGL/OpenGL.h>
|
---|
23 | #endif
|
---|
24 |
|
---|
25 | #define SPU_ENTRY_POINT_NAME "SPULoad"
|
---|
26 |
|
---|
27 | #ifdef __cplusplus
|
---|
28 | extern "C" {
|
---|
29 | #endif
|
---|
30 |
|
---|
31 | #define MAX_THREADS 32 /**< max threads per spu */
|
---|
32 |
|
---|
33 | typedef struct _SPUSTRUCT SPU;
|
---|
34 |
|
---|
35 | typedef void (*SPUGenericFunction)(void);
|
---|
36 |
|
---|
37 | /**
|
---|
38 | * SPU Named function descriptor
|
---|
39 | */
|
---|
40 | typedef struct {
|
---|
41 | char *name;
|
---|
42 | SPUGenericFunction fn;
|
---|
43 | } SPUNamedFunctionTable;
|
---|
44 |
|
---|
45 | /**
|
---|
46 | * SPU function table descriptor
|
---|
47 | */
|
---|
48 | typedef struct {
|
---|
49 | SPUDispatchTable *childCopy;
|
---|
50 | void *data;
|
---|
51 | SPUNamedFunctionTable *table;
|
---|
52 | } SPUFunctions;
|
---|
53 |
|
---|
54 | /** Init spu */
|
---|
55 | typedef SPUFunctions *(*SPUInitFuncPtr)(int id, SPU *child,
|
---|
56 | SPU *super, unsigned int, unsigned int );
|
---|
57 | typedef void (*SPUSelfDispatchFuncPtr)(SPUDispatchTable *);
|
---|
58 | /** Cleanup spu */
|
---|
59 | typedef int (*SPUCleanupFuncPtr)(void);
|
---|
60 | /** Load spu */
|
---|
61 | typedef int (*SPULoadFunction)(char **, char **, void *, void *, void *, int *);
|
---|
62 |
|
---|
63 |
|
---|
64 | /**
|
---|
65 | * masks for spu_flags
|
---|
66 | */
|
---|
67 | #define SPU_PACKER_MASK 0x1
|
---|
68 | #define SPU_NO_PACKER 0x0
|
---|
69 | #define SPU_HAS_PACKER 0x1
|
---|
70 | #define SPU_TERMINAL_MASK 0x2
|
---|
71 | #define SPU_NOT_TERMINAL 0x0
|
---|
72 | #define SPU_IS_TERMINAL 0x2
|
---|
73 | #define SPU_MAX_SERVERS_MASK 0xc
|
---|
74 | #define SPU_MAX_SERVERS_ZERO 0x0
|
---|
75 | #define SPU_MAX_SERVERS_ONE 0x4
|
---|
76 | #define SPU_MAX_SERVERS_UNLIMITED 0x8
|
---|
77 |
|
---|
78 |
|
---|
79 | /**
|
---|
80 | * SPU descriptor
|
---|
81 | */
|
---|
82 | struct _SPUSTRUCT {
|
---|
83 | char *name; /**< Name of the spu */
|
---|
84 | char *super_name; /**< Name of the super class of the spu */
|
---|
85 | int id; /**< Id num of the spu */
|
---|
86 | int spu_flags; /**< options fags for the SPU */
|
---|
87 | struct _SPUSTRUCT *superSPU; /**< Pointer to the descriptor for the super class */
|
---|
88 | CRDLL *dll; /**< pointer to shared lib for spu */
|
---|
89 | SPULoadFunction entry_point; /**< SPU's entry point (SPULoad()) */
|
---|
90 | SPUInitFuncPtr init; /**< SPU init function */
|
---|
91 | SPUSelfDispatchFuncPtr self; /**< */
|
---|
92 | SPUCleanupFuncPtr cleanup; /**< SPU cleanup func */
|
---|
93 | SPUFunctions *function_table; /**< Function table for spu */
|
---|
94 | SPUDispatchTable dispatch_table;
|
---|
95 | void *privatePtr; /**< pointer to SPU-private data */
|
---|
96 | };
|
---|
97 |
|
---|
98 |
|
---|
99 | /**
|
---|
100 | * These are the OpenGL / window system interface functions
|
---|
101 | */
|
---|
102 | #if defined(WINDOWS)
|
---|
103 | /**
|
---|
104 | * Windows/WGL
|
---|
105 | */
|
---|
106 | /*@{*/
|
---|
107 | typedef HGLRC (WGL_APIENTRY *wglCreateContextFunc_t)(HDC);
|
---|
108 | typedef void (WGL_APIENTRY *wglDeleteContextFunc_t)(HGLRC);
|
---|
109 | typedef BOOL (WGL_APIENTRY *wglShareListsFunc_t)(HGLRC,HGLRC);
|
---|
110 | typedef BOOL (WGL_APIENTRY *wglMakeCurrentFunc_t)(HDC,HGLRC);
|
---|
111 | typedef BOOL (WGL_APIENTRY *wglSwapBuffersFunc_t)(HDC);
|
---|
112 | typedef int (WGL_APIENTRY *wglChoosePixelFormatFunc_t)(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
---|
113 | typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
---|
114 | typedef int (WGL_APIENTRY *wglDescribePixelFormatFunc_t)(HDC, int, UINT, CONST PIXELFORMATDESCRIPTOR *);
|
---|
115 | typedef int (WGL_APIENTRY *wglSetPixelFormatFunc_t)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
|
---|
116 | typedef HGLRC (WGL_APIENTRY *wglGetCurrentContextFunc_t)();
|
---|
117 | typedef PROC (WGL_APIENTRY *wglGetProcAddressFunc_t)();
|
---|
118 | typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
---|
119 | typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribivEXTFunc_t)(HDC, int, int, UINT, int *, int *);
|
---|
120 | typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribfvEXTFunc_t)(HDC, int, int, UINT, int *, float *);
|
---|
121 | typedef const GLubyte *(WGL_APIENTRY *glGetStringFunc_t)( GLenum );
|
---|
122 | typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringEXTFunc_t)();
|
---|
123 | typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringARBFunc_t)(HDC);
|
---|
124 | /*@}*/
|
---|
125 | #elif defined(DARWIN)
|
---|
126 | typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
|
---|
127 | /*@}*/
|
---|
128 |
|
---|
129 | /**
|
---|
130 | * Apple/CGL
|
---|
131 | */
|
---|
132 | /*@{*/
|
---|
133 | typedef CGLError (*CGLSetCurrentContextFunc_t)( CGLContextObj );
|
---|
134 | typedef CGLContextObj (*CGLGetCurrentContextFunc_t)();
|
---|
135 |
|
---|
136 | typedef CGLError (*CGLChoosePixelFormatFunc_t)( const CGLPixelFormatAttribute *, CGLPixelFormatObj *, long * );
|
---|
137 | typedef CGLError (*CGLDestroyPixelFormatFunc_t)( CGLPixelFormatObj );
|
---|
138 | typedef CGLError (*CGLDescribePixelFormatFunc_t)( CGLPixelFormatObj , long , CGLPixelFormatAttribute , long * );
|
---|
139 |
|
---|
140 | typedef CGLError (*CGLQueryRendererInfoFunc_t)( unsigned long, CGLRendererInfoObj *, long * );
|
---|
141 | typedef CGLError (*CGLDestroyRendererInfoFunc_t)( CGLRendererInfoObj );
|
---|
142 | typedef CGLError (*CGLDescribeRendererFunc_t)( CGLRendererInfoObj, long, CGLRendererProperty, long * );
|
---|
143 |
|
---|
144 | typedef CGLError (*CGLCreateContextFunc_t)( CGLPixelFormatObj, CGLContextObj, CGLContextObj * );
|
---|
145 | typedef CGLError (*CGLDestroyContextFunc_t)( CGLContextObj );
|
---|
146 | typedef CGLError (*CGLCopyContextFunc_t)( CGLContextObj src, CGLContextObj, unsigned long );
|
---|
147 |
|
---|
148 | typedef CGLError (*CGLCreatePBufferFunc_t)( long, long, unsigned long, unsigned long, long, CGLPBufferObj * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
149 | typedef CGLError (*CGLDestroyPBufferFunc_t)( CGLPBufferObj ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
150 | typedef CGLError (*CGLDescribePBufferFunc_t)( CGLPBufferObj, long *, long *, unsigned long *, unsigned long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
151 | typedef CGLError (*CGLTexImagePBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
152 |
|
---|
153 | typedef CGLError (*CGLSetOffScreenFunc_t)( CGLContextObj, long, long, long, void * );
|
---|
154 | typedef CGLError (*CGLGetOffScreenFunc_t)( CGLContextObj, long *, long *, long *, void ** );
|
---|
155 | typedef CGLError (*CGLSetFullScreenFunc_t)( CGLContextObj );
|
---|
156 |
|
---|
157 | typedef CGLError (*CGLSetPBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long, long, long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
158 | typedef CGLError (*CGLGetPBufferFunc_t)( CGLContextObj, CGLPBufferObj *, unsigned long *, long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
159 |
|
---|
160 | typedef CGLError (*CGLClearDrawableFunc_t)( CGLContextObj );
|
---|
161 | typedef CGLError (*CGLFlushDrawableFunc_t)( CGLContextObj ); /* <-- swap buffers */
|
---|
162 |
|
---|
163 | typedef CGLError (*CGLEnableFunc_t)( CGLContextObj, CGLContextEnable );
|
---|
164 | typedef CGLError (*CGLDisableFunc_t)( CGLContextObj, CGLContextEnable );
|
---|
165 | typedef CGLError (*CGLIsEnabledFunc_t)( CGLContextObj, CGLContextEnable, long * );
|
---|
166 |
|
---|
167 | typedef CGLError (*CGLSetParameterFunc_t)( CGLContextObj, CGLContextParameter, const long * );
|
---|
168 | typedef CGLError (*CGLGetParameterFunc_t)( CGLContextObj, CGLContextParameter, long * );
|
---|
169 |
|
---|
170 | typedef CGLError (*CGLSetVirtualScreenFunc_t)( CGLContextObj, long );
|
---|
171 | typedef CGLError (*CGLGetVirtualScreenFunc_t)( CGLContextObj, long *);
|
---|
172 |
|
---|
173 | typedef CGLError (*CGLSetOptionFunc_t)( CGLGlobalOption, long );
|
---|
174 | typedef CGLError (*CGLGetOptionFunc_t)( CGLGlobalOption, long * );
|
---|
175 | typedef void (*CGLGetVersionFunc_t)( long *, long * );
|
---|
176 |
|
---|
177 | typedef const char * (*CGLErrorStringFunc_t)( CGLError );
|
---|
178 |
|
---|
179 | /** XXX \todo Undocumented CGL functions. Are these all correct? */
|
---|
180 | typedef void *CGSConnectionID;
|
---|
181 | typedef int CGSWindowID;
|
---|
182 | typedef int CGSSurfaceID;
|
---|
183 |
|
---|
184 | typedef CGLError (*CGLSetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID );
|
---|
185 | typedef CGLError (*CGLGetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID* );
|
---|
186 | typedef CGLError (*CGLUpdateContextFunc_t)( CGLContextObj );
|
---|
187 | /*@}*/
|
---|
188 | #else
|
---|
189 | /**
|
---|
190 | * X11/GLX
|
---|
191 | */
|
---|
192 | /*@{*/
|
---|
193 | typedef int (*glXGetConfigFunc_t)( Display *, XVisualInfo *, int, int * );
|
---|
194 | typedef Bool (*glXQueryExtensionFunc_t) (Display *, int *, int * );
|
---|
195 | typedef const char *(*glXQueryExtensionsStringFunc_t) (Display *, int );
|
---|
196 | typedef Bool (*glXQueryVersionFunc_t)( Display *dpy, int *maj, int *min );
|
---|
197 | typedef XVisualInfo *(*glXChooseVisualFunc_t)( Display *, int, int * );
|
---|
198 | typedef GLXContext (*glXCreateContextFunc_t)( Display *, XVisualInfo *, GLXContext, Bool );
|
---|
199 | typedef void (*glXUseXFontFunc_t)(Font font, int first, int count, int listBase);
|
---|
200 | typedef void (*glXDestroyContextFunc_t)( Display *, GLXContext );
|
---|
201 | typedef Bool (*glXIsDirectFunc_t)( Display *, GLXContext );
|
---|
202 | typedef Bool (*glXMakeCurrentFunc_t)( Display *, GLXDrawable, GLXContext );
|
---|
203 | typedef void (*glXSwapBuffersFunc_t)( Display *, GLXDrawable );
|
---|
204 | typedef CR_GLXFuncPtr (*glXGetProcAddressARBFunc_t)( const GLubyte *name );
|
---|
205 | typedef Display *(*glXGetCurrentDisplayFunc_t)( void );
|
---|
206 | typedef GLXContext (*glXGetCurrentContextFunc_t)( void );
|
---|
207 | typedef GLXDrawable (*glXGetCurrentDrawableFunc_t)( void );
|
---|
208 | typedef char * (*glXGetClientStringFunc_t)( Display *dpy, int name );
|
---|
209 | typedef void (*glXWaitGLFunc_t)(void);
|
---|
210 | typedef void (*glXWaitXFunc_t)(void);
|
---|
211 | typedef void (*glXCopyContextFunc_t)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask );
|
---|
212 | typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
|
---|
213 | typedef Bool (*glXJoinSwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint group);
|
---|
214 | typedef Bool (*glXBindSwapBarrierNVFunc_t)(Display *dpy, GLuint group, GLuint barrier);
|
---|
215 | typedef Bool (*glXQuerySwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
---|
216 | typedef Bool (*glXQueryMaxSwapGroupsNVFunc_t)(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
---|
217 | typedef Bool (*glXQueryFrameCountNVFunc_t)(Display *dpy, int screen, GLuint *count);
|
---|
218 | typedef Bool (*glXResetFrameCountNVFunc_t)(Display *dpy, int screen);
|
---|
219 | #ifdef GLX_VERSION_1_3
|
---|
220 | typedef GLXContext (*glXCreateNewContextFunc_t)( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct );
|
---|
221 | typedef GLXWindow (*glXCreateWindowFunc_t)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
---|
222 | typedef Bool (*glXMakeContextCurrentFunc_t)( Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx );
|
---|
223 | typedef GLXFBConfig *(*glXChooseFBConfigFunc_t)( Display *dpy, int screen, const int *attribList, int *nitems );
|
---|
224 | typedef GLXFBConfig *(*glXGetFBConfigsFunc_t)(Display *dpy, int screen, int *nelements);
|
---|
225 | typedef int (*glXGetFBConfigAttribFunc_t)(Display *dpy, GLXFBConfig config, int attribute, int *value);
|
---|
226 | typedef XVisualInfo *(*glXGetVisualFromFBConfigFunc_t)(Display *dpy, GLXFBConfig config);
|
---|
227 | typedef GLXPbuffer (*glXCreatePbufferFunc_t)( Display *dpy, GLXFBConfig config, const int *attribList );
|
---|
228 | typedef void (*glXDestroyPbufferFunc_t)( Display *dpy, GLXPbuffer pbuf );
|
---|
229 | typedef int (*glXQueryContextFunc_t)(Display *dpy, GLXContext ctx, int attribute, int *value);
|
---|
230 | typedef void (*glXQueryDrawableFunc_t)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
---|
231 | #endif /* GLX_VERSION_1_3 */
|
---|
232 | /*@}*/
|
---|
233 | #endif
|
---|
234 |
|
---|
235 |
|
---|
236 | /**
|
---|
237 | * Package up the WGL/AGL/CGL/GLX function pointers into a struct. We use
|
---|
238 | * this in a few different places.
|
---|
239 | */
|
---|
240 | typedef struct {
|
---|
241 | #if defined(WINDOWS)
|
---|
242 | wglGetProcAddressFunc_t wglGetProcAddress;
|
---|
243 | wglCreateContextFunc_t wglCreateContext;
|
---|
244 | wglDeleteContextFunc_t wglDeleteContext;
|
---|
245 | wglShareListsFunc_t wglShareLists;
|
---|
246 | wglMakeCurrentFunc_t wglMakeCurrent;
|
---|
247 | wglSwapBuffersFunc_t wglSwapBuffers;
|
---|
248 | wglGetCurrentContextFunc_t wglGetCurrentContext;
|
---|
249 | wglChoosePixelFormatFunc_t wglChoosePixelFormat;
|
---|
250 | wglDescribePixelFormatFunc_t wglDescribePixelFormat;
|
---|
251 | wglSetPixelFormatFunc_t wglSetPixelFormat;
|
---|
252 | wglChoosePixelFormatEXTFunc_t wglChoosePixelFormatEXT;
|
---|
253 | wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT;
|
---|
254 | wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT;
|
---|
255 | wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT;
|
---|
256 | #elif defined(DARWIN)
|
---|
257 | CGLChoosePixelFormatFunc_t CGLChoosePixelFormat;
|
---|
258 | CGLDestroyPixelFormatFunc_t CGLDestroyPixelFormat;
|
---|
259 | CGLDescribePixelFormatFunc_t CGLDescribePixelFormat;
|
---|
260 | CGLQueryRendererInfoFunc_t CGLQueryRendererInfo;
|
---|
261 | CGLDestroyRendererInfoFunc_t CGLDestroyRendererInfo;
|
---|
262 | CGLDescribeRendererFunc_t CGLDescribeRenderer;
|
---|
263 | CGLCreateContextFunc_t CGLCreateContext;
|
---|
264 | CGLDestroyContextFunc_t CGLDestroyContext;
|
---|
265 | CGLCopyContextFunc_t CGLCopyContext;
|
---|
266 | CGLSetCurrentContextFunc_t CGLSetCurrentContext;
|
---|
267 | CGLGetCurrentContextFunc_t CGLGetCurrentContext;
|
---|
268 | CGLCreatePBufferFunc_t CGLCreatePBuffer;
|
---|
269 | CGLDestroyPBufferFunc_t CGLDestroyPBuffer;
|
---|
270 | CGLDescribePBufferFunc_t CGLDescribePBuffer;
|
---|
271 | CGLTexImagePBufferFunc_t CGLTexImagePBuffer;
|
---|
272 | CGLSetOffScreenFunc_t CGLSetOffScreen;
|
---|
273 | CGLGetOffScreenFunc_t CGLGetOffScreen;
|
---|
274 | CGLSetFullScreenFunc_t CGLSetFullScreen;
|
---|
275 | CGLSetPBufferFunc_t CGLSetPBuffer;
|
---|
276 | CGLGetPBufferFunc_t CGLGetPBuffer;
|
---|
277 | CGLClearDrawableFunc_t CGLClearDrawable;
|
---|
278 | CGLFlushDrawableFunc_t CGLFlushDrawable;
|
---|
279 | CGLEnableFunc_t CGLEnable;
|
---|
280 | CGLDisableFunc_t CGLDisable;
|
---|
281 | CGLIsEnabledFunc_t CGLIsEnabled;
|
---|
282 | CGLSetParameterFunc_t CGLSetParameter;
|
---|
283 | CGLGetParameterFunc_t CGLGetParameter;
|
---|
284 | CGLSetVirtualScreenFunc_t CGLSetVirtualScreen;
|
---|
285 | CGLGetVirtualScreenFunc_t CGLGetVirtualScreen;
|
---|
286 | CGLSetOptionFunc_t CGLSetOption;
|
---|
287 | CGLGetOptionFunc_t CGLGetOption;
|
---|
288 | CGLGetVersionFunc_t CGLGetVersion;
|
---|
289 | CGLErrorStringFunc_t CGLErrorString;
|
---|
290 |
|
---|
291 | CGLSetSurfaceFunc_t CGLSetSurface;
|
---|
292 | CGLGetSurfaceFunc_t CGLGetSurface;
|
---|
293 | CGLUpdateContextFunc_t CGLUpdateContext;
|
---|
294 | #else
|
---|
295 | glXGetConfigFunc_t glXGetConfig;
|
---|
296 | glXQueryExtensionFunc_t glXQueryExtension;
|
---|
297 | glXQueryVersionFunc_t glXQueryVersion;
|
---|
298 | glXQueryExtensionsStringFunc_t glXQueryExtensionsString;
|
---|
299 | glXChooseVisualFunc_t glXChooseVisual;
|
---|
300 | glXCreateContextFunc_t glXCreateContext;
|
---|
301 | glXDestroyContextFunc_t glXDestroyContext;
|
---|
302 | glXUseXFontFunc_t glXUseXFont;
|
---|
303 | glXIsDirectFunc_t glXIsDirect;
|
---|
304 | glXMakeCurrentFunc_t glXMakeCurrent;
|
---|
305 | glXSwapBuffersFunc_t glXSwapBuffers;
|
---|
306 | glXGetProcAddressARBFunc_t glXGetProcAddressARB;
|
---|
307 | glXGetCurrentDisplayFunc_t glXGetCurrentDisplay;
|
---|
308 | glXGetCurrentContextFunc_t glXGetCurrentContext;
|
---|
309 | glXGetCurrentDrawableFunc_t glXGetCurrentDrawable;
|
---|
310 | glXGetClientStringFunc_t glXGetClientString;
|
---|
311 | glXWaitGLFunc_t glXWaitGL;
|
---|
312 | glXWaitXFunc_t glXWaitX;
|
---|
313 | glXCopyContextFunc_t glXCopyContext;
|
---|
314 | /* GLX_NV_swap_group */
|
---|
315 | glXJoinSwapGroupNVFunc_t glXJoinSwapGroupNV;
|
---|
316 | glXBindSwapBarrierNVFunc_t glXBindSwapBarrierNV;
|
---|
317 | glXQuerySwapGroupNVFunc_t glXQuerySwapGroupNV;
|
---|
318 | glXQueryMaxSwapGroupsNVFunc_t glXQueryMaxSwapGroupsNV;
|
---|
319 | glXQueryFrameCountNVFunc_t glXQueryFrameCountNV;
|
---|
320 | glXResetFrameCountNVFunc_t glXResetFrameCountNV;
|
---|
321 | #ifdef GLX_VERSION_1_3
|
---|
322 | glXCreateNewContextFunc_t glXCreateNewContext;
|
---|
323 | glXCreateWindowFunc_t glXCreateWindow;
|
---|
324 | glXMakeContextCurrentFunc_t glXMakeContextCurrent;
|
---|
325 | glXChooseFBConfigFunc_t glXChooseFBConfig;
|
---|
326 | glXGetFBConfigsFunc_t glXGetFBConfigs;
|
---|
327 | glXGetFBConfigAttribFunc_t glXGetFBConfigAttrib;
|
---|
328 | glXGetVisualFromFBConfigFunc_t glXGetVisualFromFBConfig;
|
---|
329 | glXCreatePbufferFunc_t glXCreatePbuffer;
|
---|
330 | glXDestroyPbufferFunc_t glXDestroyPbuffer;
|
---|
331 | glXQueryContextFunc_t glXQueryContext;
|
---|
332 | glXQueryDrawableFunc_t glXQueryDrawable;
|
---|
333 | #endif
|
---|
334 | #endif
|
---|
335 | glGetStringFunc_t glGetString;
|
---|
336 | } crOpenGLInterface;
|
---|
337 |
|
---|
338 |
|
---|
339 | /** This is the one required function in _all_ SPUs */
|
---|
340 | DECLEXPORT(int) SPULoad( char **name, char **super, SPUInitFuncPtr *init,
|
---|
341 | SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
|
---|
342 | int *flags );
|
---|
343 |
|
---|
344 | DECLEXPORT(SPU *) crSPULoad( SPU *child, int id, char *name, char *dir, void *server);
|
---|
345 | DECLEXPORT(SPU *) crSPULoadChain( int count, int *ids, char **names, char *dir, void *server );
|
---|
346 | DECLEXPORT(void) crSPUUnloadChain(SPU *headSPU);
|
---|
347 |
|
---|
348 | DECLEXPORT(void) crSPUInitDispatchTable( SPUDispatchTable *table );
|
---|
349 | DECLEXPORT(void) crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src );
|
---|
350 | DECLEXPORT(void) crSPUChangeInterface( SPUDispatchTable *table, void *origFunc, void *newFunc );
|
---|
351 |
|
---|
352 |
|
---|
353 | DECLEXPORT(SPUGenericFunction) crSPUFindFunction( const SPUNamedFunctionTable *table, const char *fname );
|
---|
354 | DECLEXPORT(void) crSPUInitDispatch( SPUDispatchTable *dispatch, const SPUNamedFunctionTable *table );
|
---|
355 | DECLEXPORT(void) crSPUInitDispatchNops(SPUDispatchTable *table);
|
---|
356 |
|
---|
357 | DECLEXPORT(int) crLoadOpenGL( crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
|
---|
358 | DECLEXPORT(void) crUnloadOpenGL( void );
|
---|
359 | DECLEXPORT(int) crLoadOpenGLExtensions( const crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
|
---|
360 | DECLEXPORT(void) crSPUChangeDispatch(SPUDispatchTable *dispatch, const SPUNamedFunctionTable *newtable);
|
---|
361 |
|
---|
362 | #if defined(GLX)
|
---|
363 | DECLEXPORT(XVisualInfo *)
|
---|
364 | crChooseVisual(const crOpenGLInterface *ws, Display *dpy, int screen,
|
---|
365 | GLboolean directColor, int visBits);
|
---|
366 | #else
|
---|
367 | DECLEXPORT(int)
|
---|
368 | crChooseVisual(const crOpenGLInterface *ws, int visBits);
|
---|
369 | #endif
|
---|
370 |
|
---|
371 |
|
---|
372 | #ifdef USE_OSMESA
|
---|
373 | DECLEXPORT(int)
|
---|
374 | crLoadOSMesa( OSMesaContext (**createContext)( GLenum format, OSMesaContext sharelist ),
|
---|
375 | GLboolean (**makeCurrent)( OSMesaContext ctx, GLubyte *buffer,
|
---|
376 | GLenum type, GLsizei width, GLsizei height ),
|
---|
377 | void (**destroyContext)( OSMesaContext ctx ));
|
---|
378 | #endif
|
---|
379 |
|
---|
380 | #ifdef __cplusplus
|
---|
381 | }
|
---|
382 | #endif
|
---|
383 |
|
---|
384 | #endif /* CR_SPU_H */
|
---|