VirtualBox

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

Last change on this file since 32375 was 22509, checked in by vboxsync, 15 years ago

crOpenGL-OSX: Initial version for the Cocoa port.

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