VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/cr_spu.h@ 18847

Last change on this file since 18847 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 20.9 KB
Line 
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
29extern "C" {
30#endif
31
32#define MAX_THREADS 32 /**< max threads per spu */
33
34typedef struct _SPUSTRUCT SPU;
35
36typedef void (*SPUGenericFunction)(void);
37
38/**
39 * SPU Named function descriptor
40 */
41typedef struct {
42 char *name;
43 SPUGenericFunction fn;
44} SPUNamedFunctionTable;
45
46/**
47 * SPU function table descriptor
48 */
49typedef 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 */
60typedef void (*SPUOptionCB)( void *spu, const char *response );
61
62typedef enum { CR_BOOL, CR_INT, CR_FLOAT, CR_STRING, CR_ENUM } cr_type;
63
64/**
65 * SPU Options table
66 */
67typedef 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 */
80typedef SPUFunctions *(*SPUInitFuncPtr)(int id, SPU *child,
81 SPU *super, unsigned int, unsigned int );
82typedef void (*SPUSelfDispatchFuncPtr)(SPUDispatchTable *);
83/** Cleanup spu */
84typedef int (*SPUCleanupFuncPtr)(void);
85/** Load spu */
86typedef 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 */
108struct _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/*@{*/
134typedef HGLRC (WGL_APIENTRY *wglCreateContextFunc_t)(HDC);
135typedef void (WGL_APIENTRY *wglDeleteContextFunc_t)(HGLRC);
136typedef BOOL (WGL_APIENTRY *wglMakeCurrentFunc_t)(HDC,HGLRC);
137typedef BOOL (WGL_APIENTRY *wglSwapBuffersFunc_t)(HDC);
138typedef int (WGL_APIENTRY *wglChoosePixelFormatFunc_t)(HDC, CONST PIXELFORMATDESCRIPTOR *);
139typedef int (WGL_APIENTRY *wglDescribePixelFormatFunc_t)(HDC, int, UINT, CONST PIXELFORMATDESCRIPTOR *);
140typedef int (WGL_APIENTRY *wglSetPixelFormatFunc_t)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
141typedef HGLRC (WGL_APIENTRY *wglGetCurrentContextFunc_t)();
142typedef PROC (WGL_APIENTRY *wglGetProcAddressFunc_t)();
143typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
144typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribivEXTFunc_t)(HDC, int, int, UINT, int *, int *);
145typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribfvEXTFunc_t)(HDC, int, int, UINT, int *, int *);
146typedef const GLubyte *(WGL_APIENTRY *glGetStringFunc_t)( GLenum );
147typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringEXTFunc_t)( HDC );
148/*@}*/
149#elif defined(DARWIN)
150/**
151 * Apple/AGL
152 */
153/*@{*/
154typedef AGLContext (*aglCreateContextFunc_t)( AGLPixelFormat, AGLContext );
155typedef GLboolean (*aglDestroyContextFunc_t)( AGLContext );
156typedef GLboolean (*aglSetCurrentContextFunc_t)( AGLContext );
157typedef void (*aglSwapBuffersFunc_t)( AGLContext );
158typedef AGLPixelFormat (*aglChoosePixelFormatFunc_t) (const AGLDevice *, GLint, const GLint *);
159typedef GLboolean (*aglDescribePixelFormatFunc_t)( AGLPixelFormat, GLint, GLint * );
160/* <--set pixel format */
161typedef AGLContext (*aglGetCurrentContextFunc_t)();
162/* <--get proc address -- none exists */
163typedef void* (*aglGetProcAddressFunc_t)( const GLubyte *name );
164
165/* These are here just in case */
166typedef GLboolean (*aglDescribeRendererFunc_t)( AGLRendererInfo, GLint, GLint * );
167typedef void (*aglDestroyPixelFormatFunc_t)( AGLPixelFormat );
168typedef void (*aglDestroyRendererInfoFunc_t)( AGLRendererInfo );
169typedef AGLDevice* (*aglDevicesOfPixelFormatFunc_t)( AGLPixelFormat, GLint );
170typedef GLboolean (*aglDisableFunc_t)( AGLContext, GLenum );
171typedef GLboolean (*aglEnableFunc_t)( AGLContext, GLenum );
172typedef const GLubyte* (*aglErrorStringFunc_t)( GLenum );
173typedef AGLDrawable (*aglGetDrawableFunc_t)( AGLContext );
174typedef GLenum (*aglGetErrorFunc_t)();
175typedef GLboolean (*aglGetIntegerFunc_t)( AGLContext, GLenum, GLint* );
176typedef void (*aglGetVersionFunc_t)( GLint *, GLint * );
177typedef GLint (*aglGetVirtualScreenFunc_t)( AGLContext );
178typedef GLboolean (*aglIsEnabledFunc_t)( AGLContext, GLenum );
179typedef AGLPixelFormat (*aglNextPixelFormatFunc_t)( AGLPixelFormat );
180typedef AGLRendererInfo (*aglNextRendererInfoFunc_t)( AGLRendererInfo );
181typedef AGLRendererInfo (*aglQueryRendererInfoFunc_t)( const AGLDevice *, GLint );
182typedef void (*aglReserLibraryFunc_t)();
183typedef GLboolean (*aglSetDrawableFunc_t)( AGLContext, AGLDrawable );
184typedef GLboolean (*aglSetFullScreenFunc_t)( AGLContext, GLsizei, GLsizei, GLsizei, GLint );
185typedef GLboolean (*aglSetIntegerFunc_t)( AGLContext, GLenum, const GLint * );
186typedef GLboolean (*aglSetOffScreenFunc_t)( AGLContext, GLsizei, GLsizei, GLsizei, void * );
187typedef GLboolean (*aglSetVirtualScreenFunc_t)( AGLContext, GLint );
188typedef GLboolean (*aglUpdateContextFunc_t)( AGLContext );
189typedef GLboolean (*aglUseFontFunc_t)( AGLContext, GLint, Style, GLint, GLint, GLint, GLint );
190
191typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
192/*@}*/
193
194/**
195 * Apple/CGL
196 */
197/*@{*/
198typedef CGLError (*CGLSetCurrentContextFunc_t)( CGLContextObj );
199typedef CGLContextObj (*CGLGetCurrentContextFunc_t)();
200
201typedef CGLError (*CGLChoosePixelFormatFunc_t)( const CGLPixelFormatAttribute *, CGLPixelFormatObj *, long * );
202typedef CGLError (*CGLDestroyPixelFormatFunc_t)( CGLPixelFormatObj );
203typedef CGLError (*CGLDescribePixelFormatFunc_t)( CGLPixelFormatObj , long , CGLPixelFormatAttribute , long * );
204
205typedef CGLError (*CGLQueryRendererInfoFunc_t)( unsigned long, CGLRendererInfoObj *, long * );
206typedef CGLError (*CGLDestroyRendererInfoFunc_t)( CGLRendererInfoObj );
207typedef CGLError (*CGLDescribeRendererFunc_t)( CGLRendererInfoObj, long, CGLRendererProperty, long * );
208
209typedef CGLError (*CGLCreateContextFunc_t)( CGLPixelFormatObj, CGLContextObj, CGLContextObj * );
210typedef CGLError (*CGLDestroyContextFunc_t)( CGLContextObj );
211typedef CGLError (*CGLCopyContextFunc_t)( CGLContextObj src, CGLContextObj, unsigned long );
212
213typedef CGLError (*CGLCreatePBufferFunc_t)( long, long, unsigned long, unsigned long, long, CGLPBufferObj * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
214typedef CGLError (*CGLDestroyPBufferFunc_t)( CGLPBufferObj ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
215typedef CGLError (*CGLDescribePBufferFunc_t)( CGLPBufferObj, long *, long *, unsigned long *, unsigned long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
216typedef CGLError (*CGLTexImagePBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
217
218typedef CGLError (*CGLSetOffScreenFunc_t)( CGLContextObj, long, long, long, void * );
219typedef CGLError (*CGLGetOffScreenFunc_t)( CGLContextObj, long *, long *, long *, void ** );
220typedef CGLError (*CGLSetFullScreenFunc_t)( CGLContextObj );
221
222typedef CGLError (*CGLSetPBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long, long, long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
223typedef CGLError (*CGLGetPBufferFunc_t)( CGLContextObj, CGLPBufferObj *, unsigned long *, long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
224
225typedef CGLError (*CGLClearDrawableFunc_t)( CGLContextObj );
226typedef CGLError (*CGLFlushDrawableFunc_t)( CGLContextObj ); /* <-- swap buffers */
227
228typedef CGLError (*CGLEnableFunc_t)( CGLContextObj, CGLContextEnable );
229typedef CGLError (*CGLDisableFunc_t)( CGLContextObj, CGLContextEnable );
230typedef CGLError (*CGLIsEnabledFunc_t)( CGLContextObj, CGLContextEnable, long * );
231
232typedef CGLError (*CGLSetParameterFunc_t)( CGLContextObj, CGLContextParameter, const long * );
233typedef CGLError (*CGLGetParameterFunc_t)( CGLContextObj, CGLContextParameter, long * );
234
235typedef CGLError (*CGLSetVirtualScreenFunc_t)( CGLContextObj, long );
236typedef CGLError (*CGLGetVirtualScreenFunc_t)( CGLContextObj, long *);
237
238typedef CGLError (*CGLSetOptionFunc_t)( CGLGlobalOption, long );
239typedef CGLError (*CGLGetOptionFunc_t)( CGLGlobalOption, long * );
240typedef void (*CGLGetVersionFunc_t)( long *, long * );
241
242typedef const char * (*CGLErrorStringFunc_t)( CGLError );
243
244/** XXX \todo Undocumented CGL functions. Are these all correct? */
245typedef void *CGSConnectionID;
246typedef int CGSWindowID;
247typedef int CGSSurfaceID;
248
249typedef CGLError (*CGLSetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID );
250typedef CGLError (*CGLGetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID* );
251typedef CGLError (*CGLUpdateContextFunc_t)( CGLContextObj );
252/*@}*/
253#else
254/**
255 * X11/GLX
256 */
257/*@{*/
258typedef int (*glXGetConfigFunc_t)( Display *, XVisualInfo *, int, int * );
259typedef Bool (*glXQueryExtensionFunc_t) (Display *, int *, int * );
260typedef const char *(*glXQueryExtensionsStringFunc_t) (Display *, int );
261typedef Bool (*glXQueryVersionFunc_t)( Display *dpy, int *maj, int *min );
262typedef XVisualInfo *(*glXChooseVisualFunc_t)( Display *, int, int * );
263typedef GLXContext (*glXCreateContextFunc_t)( Display *, XVisualInfo *, GLXContext, Bool );
264typedef void (*glXUseXFontFunc_t)(Font font, int first, int count, int listBase);
265typedef void (*glXDestroyContextFunc_t)( Display *, GLXContext );
266typedef Bool (*glXIsDirectFunc_t)( Display *, GLXContext );
267typedef Bool (*glXMakeCurrentFunc_t)( Display *, GLXDrawable, GLXContext );
268typedef void (*glXSwapBuffersFunc_t)( Display *, GLXDrawable );
269typedef CR_GLXFuncPtr (*glXGetProcAddressARBFunc_t)( const GLubyte *name );
270typedef Display *(*glXGetCurrentDisplayFunc_t)( void );
271typedef GLXContext (*glXGetCurrentContextFunc_t)( void );
272typedef GLXDrawable (*glXGetCurrentDrawableFunc_t)( void );
273typedef char * (*glXGetClientStringFunc_t)( Display *dpy, int name );
274typedef void (*glXWaitGLFunc_t)(void);
275typedef void (*glXWaitXFunc_t)(void);
276typedef void (*glXCopyContextFunc_t)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask );
277typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
278typedef Bool (*glXJoinSwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint group);
279typedef Bool (*glXBindSwapBarrierNVFunc_t)(Display *dpy, GLuint group, GLuint barrier);
280typedef Bool (*glXQuerySwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
281typedef Bool (*glXQueryMaxSwapGroupsNVFunc_t)(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
282typedef Bool (*glXQueryFrameCountNVFunc_t)(Display *dpy, int screen, GLuint *count);
283typedef Bool (*glXResetFrameCountNVFunc_t)(Display *dpy, int screen);
284#ifdef GLX_VERSION_1_3
285typedef GLXContext (*glXCreateNewContextFunc_t)( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct );
286typedef GLXWindow (*glXCreateWindowFunc_t)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
287typedef Bool (*glXMakeContextCurrentFunc_t)( Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx );
288typedef GLXFBConfig *(*glXChooseFBConfigFunc_t)( Display *dpy, int screen, const int *attribList, int *nitems );
289typedef GLXFBConfig *(*glXGetFBConfigsFunc_t)(Display *dpy, int screen, int *nelements);
290typedef int (*glXGetFBConfigAttribFunc_t)(Display *dpy, GLXFBConfig config, int attribute, int *value);
291typedef XVisualInfo *(*glXGetVisualFromFBConfigFunc_t)(Display *dpy, GLXFBConfig config);
292typedef GLXPbuffer (*glXCreatePbufferFunc_t)( Display *dpy, GLXFBConfig config, const int *attribList );
293typedef void (*glXDestroyPbufferFunc_t)( Display *dpy, GLXPbuffer pbuf );
294typedef int (*glXQueryContextFunc_t)(Display *dpy, GLXContext ctx, int attribute, int *value);
295typedef 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 */
305typedef 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 */
424DECLEXPORT(int) SPULoad( char **name, char **super, SPUInitFuncPtr *init,
425 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
426 SPUOptionsPtr *options, int *flags );
427
428DECLEXPORT(SPU *) crSPULoad( SPU *child, int id, char *name, char *dir, void *server);
429DECLEXPORT(SPU *) crSPULoadChain( int count, int *ids, char **names, char *dir, void *server );
430DECLEXPORT(void) crSPUUnloadChain(SPU *headSPU);
431
432DECLEXPORT(void) crSPUInitDispatchTable( SPUDispatchTable *table );
433DECLEXPORT(void) crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src );
434DECLEXPORT(void) crSPUChangeInterface( SPUDispatchTable *table, void *origFunc, void *newFunc );
435
436
437DECLEXPORT(void) crSPUSetDefaultParams( void *spu, SPUOptions *options );
438DECLEXPORT(int) crSPUGetEnumIndex( const SPUOptions *option, const char *optName, const char *value );
439
440
441DECLEXPORT(SPUGenericFunction) crSPUFindFunction( const SPUNamedFunctionTable *table, const char *fname );
442DECLEXPORT(void) crSPUInitDispatch( SPUDispatchTable *dispatch, const SPUNamedFunctionTable *table );
443DECLEXPORT(void) crSPUInitDispatchNops(SPUDispatchTable *table);
444
445DECLEXPORT(int) crLoadOpenGL( crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
446DECLEXPORT(void) crUnloadOpenGL( void );
447DECLEXPORT(int) crLoadOpenGLExtensions( const crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
448
449#if defined(GLX)
450DECLEXPORT(XVisualInfo *)
451crChooseVisual(const crOpenGLInterface *ws, Display *dpy, int screen,
452 GLboolean directColor, int visBits);
453#else
454DECLEXPORT(int)
455crChooseVisual(const crOpenGLInterface *ws, int visBits);
456#endif
457
458
459#ifdef USE_OSMESA
460DECLEXPORT(int)
461crLoadOSMesa( 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 */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette