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