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 | * SPU registration restructure.
|
---|
80 | */
|
---|
81 | typedef struct SPUREG
|
---|
82 | {
|
---|
83 | /** SPU name. */
|
---|
84 | const char *pszName;
|
---|
85 | /** Name of the SPU super class. */
|
---|
86 | const char *pszSuperName;
|
---|
87 | /** SPU flags. */
|
---|
88 | uint32_t fFlags;
|
---|
89 | /** Init function. */
|
---|
90 | SPUInitFuncPtr pfnInit;
|
---|
91 | /** Dispatch function. */
|
---|
92 | SPUSelfDispatchFuncPtr pfnDispatch;
|
---|
93 | /** Cleanup function. */
|
---|
94 | SPUCleanupFuncPtr pfnCleanup;
|
---|
95 | } SPUREG;
|
---|
96 | /** Pointer to a SPU registration structure. */
|
---|
97 | typedef SPUREG *PSPUREG;
|
---|
98 | /** Pointer to a const SPU registration structure. */
|
---|
99 | typedef const SPUREG *PCSPUREG;
|
---|
100 |
|
---|
101 | /**
|
---|
102 | * SPU descriptor
|
---|
103 | */
|
---|
104 | struct _SPUSTRUCT {
|
---|
105 | char *name; /**< Name of the spu */
|
---|
106 | char *super_name; /**< Name of the super class of the spu */
|
---|
107 | int id; /**< Id num of the spu */
|
---|
108 | int spu_flags; /**< options fags for the SPU */
|
---|
109 | struct _SPUSTRUCT *superSPU; /**< Pointer to the descriptor for the super class */
|
---|
110 | CRDLL *dll; /**< pointer to shared lib for spu */
|
---|
111 | SPULoadFunction entry_point; /**< SPU's entry point (SPULoad()) */
|
---|
112 | SPUInitFuncPtr init; /**< SPU init function */
|
---|
113 | SPUSelfDispatchFuncPtr self; /**< */
|
---|
114 | SPUCleanupFuncPtr cleanup; /**< SPU cleanup func */
|
---|
115 | SPUFunctions *function_table; /**< Function table for spu */
|
---|
116 | SPUDispatchTable dispatch_table;
|
---|
117 | void *privatePtr; /**< pointer to SPU-private data */
|
---|
118 | };
|
---|
119 |
|
---|
120 |
|
---|
121 | /**
|
---|
122 | * These are the OpenGL / window system interface functions
|
---|
123 | */
|
---|
124 | #if defined(WINDOWS)
|
---|
125 | /**
|
---|
126 | * Windows/WGL
|
---|
127 | */
|
---|
128 | /*@{*/
|
---|
129 | typedef HGLRC (WGL_APIENTRY *wglCreateContextFunc_t)(HDC);
|
---|
130 | typedef void (WGL_APIENTRY *wglDeleteContextFunc_t)(HGLRC);
|
---|
131 | typedef BOOL (WGL_APIENTRY *wglShareListsFunc_t)(HGLRC,HGLRC);
|
---|
132 | typedef BOOL (WGL_APIENTRY *wglMakeCurrentFunc_t)(HDC,HGLRC);
|
---|
133 | typedef BOOL (WGL_APIENTRY *wglSwapBuffersFunc_t)(HDC);
|
---|
134 | typedef int (WGL_APIENTRY *wglChoosePixelFormatFunc_t)(HDC, CONST PIXELFORMATDESCRIPTOR *);
|
---|
135 | typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
---|
136 | typedef int (WGL_APIENTRY *wglDescribePixelFormatFunc_t)(HDC, int, UINT, CONST PIXELFORMATDESCRIPTOR *);
|
---|
137 | typedef int (WGL_APIENTRY *wglSetPixelFormatFunc_t)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
|
---|
138 | typedef HGLRC (WGL_APIENTRY *wglGetCurrentContextFunc_t)(void);
|
---|
139 | typedef PROC (WGL_APIENTRY *wglGetProcAddressFunc_t)(LPCSTR Arg1);
|
---|
140 | typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
|
---|
141 | typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribivEXTFunc_t)(HDC, int, int, UINT, int *, int *);
|
---|
142 | typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribfvEXTFunc_t)(HDC, int, int, UINT, int *, float *);
|
---|
143 | typedef const GLubyte *(WGL_APIENTRY *glGetStringFunc_t)( GLenum );
|
---|
144 | typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringEXTFunc_t)(void);
|
---|
145 | typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringARBFunc_t)(HDC);
|
---|
146 | /*@}*/
|
---|
147 | #elif defined(DARWIN)
|
---|
148 | typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
|
---|
149 | /*@}*/
|
---|
150 |
|
---|
151 | /**
|
---|
152 | * Apple/CGL
|
---|
153 | */
|
---|
154 | /*@{*/
|
---|
155 | typedef CGLError (*CGLSetCurrentContextFunc_t)( CGLContextObj );
|
---|
156 | typedef CGLContextObj (*CGLGetCurrentContextFunc_t)();
|
---|
157 |
|
---|
158 | typedef CGLError (*CGLChoosePixelFormatFunc_t)( const CGLPixelFormatAttribute *, CGLPixelFormatObj *, long * );
|
---|
159 | typedef CGLError (*CGLDestroyPixelFormatFunc_t)( CGLPixelFormatObj );
|
---|
160 | typedef CGLError (*CGLDescribePixelFormatFunc_t)( CGLPixelFormatObj , long , CGLPixelFormatAttribute , long * );
|
---|
161 |
|
---|
162 | typedef CGLError (*CGLQueryRendererInfoFunc_t)( unsigned long, CGLRendererInfoObj *, long * );
|
---|
163 | typedef CGLError (*CGLDestroyRendererInfoFunc_t)( CGLRendererInfoObj );
|
---|
164 | typedef CGLError (*CGLDescribeRendererFunc_t)( CGLRendererInfoObj, long, CGLRendererProperty, long * );
|
---|
165 |
|
---|
166 | typedef CGLError (*CGLCreateContextFunc_t)( CGLPixelFormatObj, CGLContextObj, CGLContextObj * );
|
---|
167 | typedef CGLError (*CGLDestroyContextFunc_t)( CGLContextObj );
|
---|
168 | typedef CGLError (*CGLCopyContextFunc_t)( CGLContextObj src, CGLContextObj, unsigned long );
|
---|
169 |
|
---|
170 | typedef CGLError (*CGLCreatePBufferFunc_t)( long, long, unsigned long, unsigned long, long, CGLPBufferObj * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
171 | typedef CGLError (*CGLDestroyPBufferFunc_t)( CGLPBufferObj ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
172 | typedef CGLError (*CGLDescribePBufferFunc_t)( CGLPBufferObj, long *, long *, unsigned long *, unsigned long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
173 | typedef CGLError (*CGLTexImagePBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
174 |
|
---|
175 | typedef CGLError (*CGLSetOffScreenFunc_t)( CGLContextObj, long, long, long, void * );
|
---|
176 | typedef CGLError (*CGLGetOffScreenFunc_t)( CGLContextObj, long *, long *, long *, void ** );
|
---|
177 | typedef CGLError (*CGLSetFullScreenFunc_t)( CGLContextObj );
|
---|
178 |
|
---|
179 | typedef CGLError (*CGLSetPBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long, long, long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
180 | typedef CGLError (*CGLGetPBufferFunc_t)( CGLContextObj, CGLPBufferObj *, unsigned long *, long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
|
---|
181 |
|
---|
182 | typedef CGLError (*CGLClearDrawableFunc_t)( CGLContextObj );
|
---|
183 | typedef CGLError (*CGLFlushDrawableFunc_t)( CGLContextObj ); /* <-- swap buffers */
|
---|
184 |
|
---|
185 | typedef CGLError (*CGLEnableFunc_t)( CGLContextObj, CGLContextEnable );
|
---|
186 | typedef CGLError (*CGLDisableFunc_t)( CGLContextObj, CGLContextEnable );
|
---|
187 | typedef CGLError (*CGLIsEnabledFunc_t)( CGLContextObj, CGLContextEnable, long * );
|
---|
188 |
|
---|
189 | typedef CGLError (*CGLSetParameterFunc_t)( CGLContextObj, CGLContextParameter, const long * );
|
---|
190 | typedef CGLError (*CGLGetParameterFunc_t)( CGLContextObj, CGLContextParameter, long * );
|
---|
191 |
|
---|
192 | typedef CGLError (*CGLSetVirtualScreenFunc_t)( CGLContextObj, long );
|
---|
193 | typedef CGLError (*CGLGetVirtualScreenFunc_t)( CGLContextObj, long *);
|
---|
194 |
|
---|
195 | typedef CGLError (*CGLSetOptionFunc_t)( CGLGlobalOption, long );
|
---|
196 | typedef CGLError (*CGLGetOptionFunc_t)( CGLGlobalOption, long * );
|
---|
197 | typedef void (*CGLGetVersionFunc_t)( long *, long * );
|
---|
198 |
|
---|
199 | typedef const char * (*CGLErrorStringFunc_t)( CGLError );
|
---|
200 |
|
---|
201 | /** XXX \todo Undocumented CGL functions. Are these all correct? */
|
---|
202 | typedef void *CGSConnectionID;
|
---|
203 | typedef int CGSWindowID;
|
---|
204 | typedef int CGSSurfaceID;
|
---|
205 |
|
---|
206 | typedef CGLError (*CGLSetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID );
|
---|
207 | typedef CGLError (*CGLGetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID* );
|
---|
208 | typedef CGLError (*CGLUpdateContextFunc_t)( CGLContextObj );
|
---|
209 | /*@}*/
|
---|
210 | #else
|
---|
211 | /**
|
---|
212 | * X11/GLX
|
---|
213 | */
|
---|
214 | /*@{*/
|
---|
215 | typedef int (*glXGetConfigFunc_t)( Display *, XVisualInfo *, int, int * );
|
---|
216 | typedef Bool (*glXQueryExtensionFunc_t) (Display *, int *, int * );
|
---|
217 | typedef const char *(*glXQueryExtensionsStringFunc_t) (Display *, int );
|
---|
218 | typedef Bool (*glXQueryVersionFunc_t)( Display *dpy, int *maj, int *min );
|
---|
219 | typedef XVisualInfo *(*glXChooseVisualFunc_t)( Display *, int, int * );
|
---|
220 | typedef GLXContext (*glXCreateContextFunc_t)( Display *, XVisualInfo *, GLXContext, Bool );
|
---|
221 | typedef void (*glXUseXFontFunc_t)(Font font, int first, int count, int listBase);
|
---|
222 | typedef void (*glXDestroyContextFunc_t)( Display *, GLXContext );
|
---|
223 | typedef Bool (*glXIsDirectFunc_t)( Display *, GLXContext );
|
---|
224 | typedef Bool (*glXMakeCurrentFunc_t)( Display *, GLXDrawable, GLXContext );
|
---|
225 | typedef void (*glXSwapBuffersFunc_t)( Display *, GLXDrawable );
|
---|
226 | typedef CR_GLXFuncPtr (*glXGetProcAddressARBFunc_t)( const GLubyte *name );
|
---|
227 | typedef Display *(*glXGetCurrentDisplayFunc_t)( void );
|
---|
228 | typedef GLXContext (*glXGetCurrentContextFunc_t)( void );
|
---|
229 | typedef GLXDrawable (*glXGetCurrentDrawableFunc_t)( void );
|
---|
230 | typedef char * (*glXGetClientStringFunc_t)( Display *dpy, int name );
|
---|
231 | typedef void (*glXWaitGLFunc_t)(void);
|
---|
232 | typedef void (*glXWaitXFunc_t)(void);
|
---|
233 | typedef void (*glXCopyContextFunc_t)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask );
|
---|
234 | typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
|
---|
235 | typedef Bool (*glXJoinSwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint group);
|
---|
236 | typedef Bool (*glXBindSwapBarrierNVFunc_t)(Display *dpy, GLuint group, GLuint barrier);
|
---|
237 | typedef Bool (*glXQuerySwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
---|
238 | typedef Bool (*glXQueryMaxSwapGroupsNVFunc_t)(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
---|
239 | typedef Bool (*glXQueryFrameCountNVFunc_t)(Display *dpy, int screen, GLuint *count);
|
---|
240 | typedef Bool (*glXResetFrameCountNVFunc_t)(Display *dpy, int screen);
|
---|
241 | #ifdef GLX_VERSION_1_3
|
---|
242 | typedef GLXContext (*glXCreateNewContextFunc_t)( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct );
|
---|
243 | typedef GLXWindow (*glXCreateWindowFunc_t)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
---|
244 | typedef Bool (*glXMakeContextCurrentFunc_t)( Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx );
|
---|
245 | typedef GLXFBConfig *(*glXChooseFBConfigFunc_t)( Display *dpy, int screen, const int *attribList, int *nitems );
|
---|
246 | typedef GLXFBConfig *(*glXGetFBConfigsFunc_t)(Display *dpy, int screen, int *nelements);
|
---|
247 | typedef int (*glXGetFBConfigAttribFunc_t)(Display *dpy, GLXFBConfig config, int attribute, int *value);
|
---|
248 | typedef XVisualInfo *(*glXGetVisualFromFBConfigFunc_t)(Display *dpy, GLXFBConfig config);
|
---|
249 | typedef GLXPbuffer (*glXCreatePbufferFunc_t)( Display *dpy, GLXFBConfig config, const int *attribList );
|
---|
250 | typedef void (*glXDestroyPbufferFunc_t)( Display *dpy, GLXPbuffer pbuf );
|
---|
251 | typedef int (*glXQueryContextFunc_t)(Display *dpy, GLXContext ctx, int attribute, int *value);
|
---|
252 | typedef void (*glXQueryDrawableFunc_t)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
---|
253 | #endif /* GLX_VERSION_1_3 */
|
---|
254 | /*@}*/
|
---|
255 | #endif
|
---|
256 |
|
---|
257 |
|
---|
258 | /**
|
---|
259 | * Package up the WGL/AGL/CGL/GLX function pointers into a struct. We use
|
---|
260 | * this in a few different places.
|
---|
261 | */
|
---|
262 | typedef struct {
|
---|
263 | #if defined(WINDOWS)
|
---|
264 | wglGetProcAddressFunc_t wglGetProcAddress;
|
---|
265 | wglCreateContextFunc_t wglCreateContext;
|
---|
266 | wglDeleteContextFunc_t wglDeleteContext;
|
---|
267 | wglShareListsFunc_t wglShareLists;
|
---|
268 | wglMakeCurrentFunc_t wglMakeCurrent;
|
---|
269 | wglSwapBuffersFunc_t wglSwapBuffers;
|
---|
270 | wglGetCurrentContextFunc_t wglGetCurrentContext;
|
---|
271 | wglChoosePixelFormatFunc_t wglChoosePixelFormat;
|
---|
272 | wglDescribePixelFormatFunc_t wglDescribePixelFormat;
|
---|
273 | wglSetPixelFormatFunc_t wglSetPixelFormat;
|
---|
274 | wglChoosePixelFormatEXTFunc_t wglChoosePixelFormatEXT;
|
---|
275 | wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT;
|
---|
276 | wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT;
|
---|
277 | wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT;
|
---|
278 | #elif defined(DARWIN)
|
---|
279 | CGLChoosePixelFormatFunc_t CGLChoosePixelFormat;
|
---|
280 | CGLDestroyPixelFormatFunc_t CGLDestroyPixelFormat;
|
---|
281 | CGLDescribePixelFormatFunc_t CGLDescribePixelFormat;
|
---|
282 | CGLQueryRendererInfoFunc_t CGLQueryRendererInfo;
|
---|
283 | CGLDestroyRendererInfoFunc_t CGLDestroyRendererInfo;
|
---|
284 | CGLDescribeRendererFunc_t CGLDescribeRenderer;
|
---|
285 | CGLCreateContextFunc_t CGLCreateContext;
|
---|
286 | CGLDestroyContextFunc_t CGLDestroyContext;
|
---|
287 | CGLCopyContextFunc_t CGLCopyContext;
|
---|
288 | CGLSetCurrentContextFunc_t CGLSetCurrentContext;
|
---|
289 | CGLGetCurrentContextFunc_t CGLGetCurrentContext;
|
---|
290 | CGLCreatePBufferFunc_t CGLCreatePBuffer;
|
---|
291 | CGLDestroyPBufferFunc_t CGLDestroyPBuffer;
|
---|
292 | CGLDescribePBufferFunc_t CGLDescribePBuffer;
|
---|
293 | CGLTexImagePBufferFunc_t CGLTexImagePBuffer;
|
---|
294 | CGLSetOffScreenFunc_t CGLSetOffScreen;
|
---|
295 | CGLGetOffScreenFunc_t CGLGetOffScreen;
|
---|
296 | CGLSetFullScreenFunc_t CGLSetFullScreen;
|
---|
297 | CGLSetPBufferFunc_t CGLSetPBuffer;
|
---|
298 | CGLGetPBufferFunc_t CGLGetPBuffer;
|
---|
299 | CGLClearDrawableFunc_t CGLClearDrawable;
|
---|
300 | CGLFlushDrawableFunc_t CGLFlushDrawable;
|
---|
301 | CGLEnableFunc_t CGLEnable;
|
---|
302 | CGLDisableFunc_t CGLDisable;
|
---|
303 | CGLIsEnabledFunc_t CGLIsEnabled;
|
---|
304 | CGLSetParameterFunc_t CGLSetParameter;
|
---|
305 | CGLGetParameterFunc_t CGLGetParameter;
|
---|
306 | CGLSetVirtualScreenFunc_t CGLSetVirtualScreen;
|
---|
307 | CGLGetVirtualScreenFunc_t CGLGetVirtualScreen;
|
---|
308 | CGLSetOptionFunc_t CGLSetOption;
|
---|
309 | CGLGetOptionFunc_t CGLGetOption;
|
---|
310 | CGLGetVersionFunc_t CGLGetVersion;
|
---|
311 | CGLErrorStringFunc_t CGLErrorString;
|
---|
312 |
|
---|
313 | CGLSetSurfaceFunc_t CGLSetSurface;
|
---|
314 | CGLGetSurfaceFunc_t CGLGetSurface;
|
---|
315 | CGLUpdateContextFunc_t CGLUpdateContext;
|
---|
316 | #else
|
---|
317 | glXGetConfigFunc_t glXGetConfig;
|
---|
318 | glXQueryExtensionFunc_t glXQueryExtension;
|
---|
319 | glXQueryVersionFunc_t glXQueryVersion;
|
---|
320 | glXQueryExtensionsStringFunc_t glXQueryExtensionsString;
|
---|
321 | glXChooseVisualFunc_t glXChooseVisual;
|
---|
322 | glXCreateContextFunc_t glXCreateContext;
|
---|
323 | glXDestroyContextFunc_t glXDestroyContext;
|
---|
324 | glXUseXFontFunc_t glXUseXFont;
|
---|
325 | glXIsDirectFunc_t glXIsDirect;
|
---|
326 | glXMakeCurrentFunc_t glXMakeCurrent;
|
---|
327 | glXSwapBuffersFunc_t glXSwapBuffers;
|
---|
328 | glXGetProcAddressARBFunc_t glXGetProcAddressARB;
|
---|
329 | glXGetCurrentDisplayFunc_t glXGetCurrentDisplay;
|
---|
330 | glXGetCurrentContextFunc_t glXGetCurrentContext;
|
---|
331 | glXGetCurrentDrawableFunc_t glXGetCurrentDrawable;
|
---|
332 | glXGetClientStringFunc_t glXGetClientString;
|
---|
333 | glXWaitGLFunc_t glXWaitGL;
|
---|
334 | glXWaitXFunc_t glXWaitX;
|
---|
335 | glXCopyContextFunc_t glXCopyContext;
|
---|
336 | /* GLX_NV_swap_group */
|
---|
337 | glXJoinSwapGroupNVFunc_t glXJoinSwapGroupNV;
|
---|
338 | glXBindSwapBarrierNVFunc_t glXBindSwapBarrierNV;
|
---|
339 | glXQuerySwapGroupNVFunc_t glXQuerySwapGroupNV;
|
---|
340 | glXQueryMaxSwapGroupsNVFunc_t glXQueryMaxSwapGroupsNV;
|
---|
341 | glXQueryFrameCountNVFunc_t glXQueryFrameCountNV;
|
---|
342 | glXResetFrameCountNVFunc_t glXResetFrameCountNV;
|
---|
343 | #ifdef GLX_VERSION_1_3
|
---|
344 | glXCreateNewContextFunc_t glXCreateNewContext;
|
---|
345 | glXCreateWindowFunc_t glXCreateWindow;
|
---|
346 | glXMakeContextCurrentFunc_t glXMakeContextCurrent;
|
---|
347 | glXChooseFBConfigFunc_t glXChooseFBConfig;
|
---|
348 | glXGetFBConfigsFunc_t glXGetFBConfigs;
|
---|
349 | glXGetFBConfigAttribFunc_t glXGetFBConfigAttrib;
|
---|
350 | glXGetVisualFromFBConfigFunc_t glXGetVisualFromFBConfig;
|
---|
351 | glXCreatePbufferFunc_t glXCreatePbuffer;
|
---|
352 | glXDestroyPbufferFunc_t glXDestroyPbuffer;
|
---|
353 | glXQueryContextFunc_t glXQueryContext;
|
---|
354 | glXQueryDrawableFunc_t glXQueryDrawable;
|
---|
355 | #endif
|
---|
356 | #endif
|
---|
357 | glGetStringFunc_t glGetString;
|
---|
358 | } crOpenGLInterface;
|
---|
359 |
|
---|
360 |
|
---|
361 | /** This is the one required function in _all_ SPUs */
|
---|
362 | DECLEXPORT(int) SPULoad( char **name, char **super, SPUInitFuncPtr *init,
|
---|
363 | SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
|
---|
364 | int *flags );
|
---|
365 |
|
---|
366 | DECLEXPORT(SPU *) crSPULoad( SPU *child, int id, char *name, char *dir, void *server);
|
---|
367 | DECLEXPORT(SPU *) crSPULoadChain( int count, int *ids, char **names, char *dir, void *server );
|
---|
368 | DECLEXPORT(void) crSPUUnloadChain(SPU *headSPU);
|
---|
369 |
|
---|
370 | DECLEXPORT(SPU *) crSPUInitFromReg(SPU *pSpuChild, int iId, const char *pszName, void *pvServer, PCSPUREG *papSpuReg);
|
---|
371 | DECLEXPORT(SPU *) crSPUInitChainFromReg(int cSpus, int *paIds, const char * const *papszNames, void *server, PCSPUREG *papSpuReg);
|
---|
372 |
|
---|
373 | DECLEXPORT(void) crSPUInitDispatchTable( SPUDispatchTable *table );
|
---|
374 | DECLEXPORT(void) crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src );
|
---|
375 | DECLEXPORT(void) crSPUChangeInterface( SPUDispatchTable *table, void *origFunc, void *newFunc );
|
---|
376 |
|
---|
377 |
|
---|
378 | DECLEXPORT(SPUGenericFunction) crSPUFindFunction( const SPUNamedFunctionTable *table, const char *fname );
|
---|
379 | DECLEXPORT(void) crSPUInitDispatch( SPUDispatchTable *dispatch, const SPUNamedFunctionTable *table );
|
---|
380 | DECLEXPORT(void) crSPUInitDispatchNops(SPUDispatchTable *table);
|
---|
381 |
|
---|
382 | DECLEXPORT(int) crLoadOpenGL( crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
|
---|
383 | DECLEXPORT(void) crUnloadOpenGL( void );
|
---|
384 | DECLEXPORT(int) crLoadOpenGLExtensions( const crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
|
---|
385 | DECLEXPORT(void) crSPUChangeDispatch(SPUDispatchTable *dispatch, const SPUNamedFunctionTable *newtable);
|
---|
386 |
|
---|
387 | #if defined(GLX)
|
---|
388 | DECLEXPORT(XVisualInfo *)
|
---|
389 | crChooseVisual(const crOpenGLInterface *ws, Display *dpy, int screen,
|
---|
390 | GLboolean directColor, int visBits);
|
---|
391 | #else
|
---|
392 | DECLEXPORT(int)
|
---|
393 | crChooseVisual(const crOpenGLInterface *ws, int visBits);
|
---|
394 | #endif
|
---|
395 |
|
---|
396 |
|
---|
397 | #ifdef USE_OSMESA
|
---|
398 | DECLEXPORT(int)
|
---|
399 | crLoadOSMesa( OSMesaContext (**createContext)( GLenum format, OSMesaContext sharelist ),
|
---|
400 | GLboolean (**makeCurrent)( OSMesaContext ctx, GLubyte *buffer,
|
---|
401 | GLenum type, GLsizei width, GLsizei height ),
|
---|
402 | void (**destroyContext)( OSMesaContext ctx ));
|
---|
403 | #endif
|
---|
404 |
|
---|
405 | extern DECLHIDDEN(const SPUREG) g_ErrorSpuReg;
|
---|
406 | #ifdef IN_GUEST
|
---|
407 | extern DECLHIDDEN(const SPUREG) g_FeedbackSpuReg;
|
---|
408 | extern DECLHIDDEN(const SPUREG) g_PassthroughSpuReg;
|
---|
409 | extern DECLHIDDEN(const SPUREG) g_PackSpuReg;
|
---|
410 | #else
|
---|
411 | extern DECLHIDDEN(const SPUREG) g_RenderSpuReg;
|
---|
412 | #endif
|
---|
413 |
|
---|
414 | #ifdef __cplusplus
|
---|
415 | }
|
---|
416 | #endif
|
---|
417 |
|
---|
418 | #endif /* CR_SPU_H */
|
---|