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