VirtualBox

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

最後變更 在這個檔案從71007是 69474,由 vboxsync 提交於 7 年 前

*: scm updates - header files should have 'svn:keywords=Id Revision' too (doesn't mean they have to use them).

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id Revision
檔案大小: 21.4 KB
 
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 *wglShareListsFunc_t)(HGLRC,HGLRC);
140typedef BOOL (WGL_APIENTRY *wglMakeCurrentFunc_t)(HDC,HGLRC);
141typedef BOOL (WGL_APIENTRY *wglSwapBuffersFunc_t)(HDC);
142typedef int (WGL_APIENTRY *wglChoosePixelFormatFunc_t)(HDC, CONST PIXELFORMATDESCRIPTOR *);
143typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
144typedef int (WGL_APIENTRY *wglDescribePixelFormatFunc_t)(HDC, int, UINT, CONST PIXELFORMATDESCRIPTOR *);
145typedef int (WGL_APIENTRY *wglSetPixelFormatFunc_t)(HDC, int, CONST PIXELFORMATDESCRIPTOR *);
146typedef HGLRC (WGL_APIENTRY *wglGetCurrentContextFunc_t)();
147typedef PROC (WGL_APIENTRY *wglGetProcAddressFunc_t)();
148typedef BOOL (WGL_APIENTRY *wglChoosePixelFormatEXTFunc_t)(HDC, const int *, const FLOAT *, UINT, int *, UINT *);
149typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribivEXTFunc_t)(HDC, int, int, UINT, int *, int *);
150typedef BOOL (WGL_APIENTRY *wglGetPixelFormatAttribfvEXTFunc_t)(HDC, int, int, UINT, int *, float *);
151typedef const GLubyte *(WGL_APIENTRY *glGetStringFunc_t)( GLenum );
152typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringEXTFunc_t)();
153typedef const GLubyte *(WGL_APIENTRY *wglGetExtensionsStringARBFunc_t)(HDC);
154/*@}*/
155#elif defined(DARWIN)
156# ifndef VBOX_WITH_COCOA_QT
157/**
158 * Apple/AGL
159 */
160/*@{*/
161typedef AGLContext (*aglCreateContextFunc_t)( AGLPixelFormat, AGLContext );
162typedef GLboolean (*aglDestroyContextFunc_t)( AGLContext );
163typedef GLboolean (*aglSetCurrentContextFunc_t)( AGLContext );
164typedef void (*aglSwapBuffersFunc_t)( AGLContext );
165typedef AGLPixelFormat (*aglChoosePixelFormatFunc_t) (const AGLDevice *, GLint, const GLint *);
166typedef GLboolean (*aglDescribePixelFormatFunc_t)( AGLPixelFormat, GLint, GLint * );
167/* <--set pixel format */
168typedef AGLContext (*aglGetCurrentContextFunc_t)();
169/* <--get proc address -- none exists */
170typedef void* (*aglGetProcAddressFunc_t)( const GLubyte *name );
171
172/* These are here just in case */
173typedef GLboolean (*aglDescribeRendererFunc_t)( AGLRendererInfo, GLint, GLint * );
174typedef void (*aglDestroyPixelFormatFunc_t)( AGLPixelFormat );
175typedef void (*aglDestroyRendererInfoFunc_t)( AGLRendererInfo );
176typedef AGLDevice* (*aglDevicesOfPixelFormatFunc_t)( AGLPixelFormat, GLint );
177typedef GLboolean (*aglDisableFunc_t)( AGLContext, GLenum );
178typedef GLboolean (*aglEnableFunc_t)( AGLContext, GLenum );
179typedef const GLubyte* (*aglErrorStringFunc_t)( GLenum );
180typedef AGLDrawable (*aglGetDrawableFunc_t)( AGLContext );
181typedef GLenum (*aglGetErrorFunc_t)();
182typedef GLboolean (*aglGetIntegerFunc_t)( AGLContext, GLenum, GLint* );
183typedef void (*aglGetVersionFunc_t)( GLint *, GLint * );
184typedef GLint (*aglGetVirtualScreenFunc_t)( AGLContext );
185typedef GLboolean (*aglIsEnabledFunc_t)( AGLContext, GLenum );
186typedef AGLPixelFormat (*aglNextPixelFormatFunc_t)( AGLPixelFormat );
187typedef AGLRendererInfo (*aglNextRendererInfoFunc_t)( AGLRendererInfo );
188typedef AGLRendererInfo (*aglQueryRendererInfoFunc_t)( const AGLDevice *, GLint );
189typedef void (*aglReserLibraryFunc_t)();
190typedef GLboolean (*aglSetDrawableFunc_t)( AGLContext, AGLDrawable );
191typedef GLboolean (*aglSetFullScreenFunc_t)( AGLContext, GLsizei, GLsizei, GLsizei, GLint );
192typedef GLboolean (*aglSetIntegerFunc_t)( AGLContext, GLenum, const GLint * );
193typedef GLboolean (*aglSetOffScreenFunc_t)( AGLContext, GLsizei, GLsizei, GLsizei, void * );
194typedef GLboolean (*aglSetVirtualScreenFunc_t)( AGLContext, GLint );
195typedef GLboolean (*aglUpdateContextFunc_t)( AGLContext );
196typedef GLboolean (*aglUseFontFunc_t)( AGLContext, GLint, Style, GLint, GLint, GLint, GLint );
197# endif
198
199typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
200/*@}*/
201
202/**
203 * Apple/CGL
204 */
205/*@{*/
206typedef CGLError (*CGLSetCurrentContextFunc_t)( CGLContextObj );
207typedef CGLContextObj (*CGLGetCurrentContextFunc_t)();
208
209typedef CGLError (*CGLChoosePixelFormatFunc_t)( const CGLPixelFormatAttribute *, CGLPixelFormatObj *, long * );
210typedef CGLError (*CGLDestroyPixelFormatFunc_t)( CGLPixelFormatObj );
211typedef CGLError (*CGLDescribePixelFormatFunc_t)( CGLPixelFormatObj , long , CGLPixelFormatAttribute , long * );
212
213typedef CGLError (*CGLQueryRendererInfoFunc_t)( unsigned long, CGLRendererInfoObj *, long * );
214typedef CGLError (*CGLDestroyRendererInfoFunc_t)( CGLRendererInfoObj );
215typedef CGLError (*CGLDescribeRendererFunc_t)( CGLRendererInfoObj, long, CGLRendererProperty, long * );
216
217typedef CGLError (*CGLCreateContextFunc_t)( CGLPixelFormatObj, CGLContextObj, CGLContextObj * );
218typedef CGLError (*CGLDestroyContextFunc_t)( CGLContextObj );
219typedef CGLError (*CGLCopyContextFunc_t)( CGLContextObj src, CGLContextObj, unsigned long );
220
221typedef CGLError (*CGLCreatePBufferFunc_t)( long, long, unsigned long, unsigned long, long, CGLPBufferObj * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
222typedef CGLError (*CGLDestroyPBufferFunc_t)( CGLPBufferObj ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
223typedef CGLError (*CGLDescribePBufferFunc_t)( CGLPBufferObj, long *, long *, unsigned long *, unsigned long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
224typedef CGLError (*CGLTexImagePBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
225
226typedef CGLError (*CGLSetOffScreenFunc_t)( CGLContextObj, long, long, long, void * );
227typedef CGLError (*CGLGetOffScreenFunc_t)( CGLContextObj, long *, long *, long *, void ** );
228typedef CGLError (*CGLSetFullScreenFunc_t)( CGLContextObj );
229
230typedef CGLError (*CGLSetPBufferFunc_t)( CGLContextObj, CGLPBufferObj, unsigned long, long, long ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
231typedef CGLError (*CGLGetPBufferFunc_t)( CGLContextObj, CGLPBufferObj *, unsigned long *, long *, long * ) AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER;
232
233typedef CGLError (*CGLClearDrawableFunc_t)( CGLContextObj );
234typedef CGLError (*CGLFlushDrawableFunc_t)( CGLContextObj ); /* <-- swap buffers */
235
236typedef CGLError (*CGLEnableFunc_t)( CGLContextObj, CGLContextEnable );
237typedef CGLError (*CGLDisableFunc_t)( CGLContextObj, CGLContextEnable );
238typedef CGLError (*CGLIsEnabledFunc_t)( CGLContextObj, CGLContextEnable, long * );
239
240typedef CGLError (*CGLSetParameterFunc_t)( CGLContextObj, CGLContextParameter, const long * );
241typedef CGLError (*CGLGetParameterFunc_t)( CGLContextObj, CGLContextParameter, long * );
242
243typedef CGLError (*CGLSetVirtualScreenFunc_t)( CGLContextObj, long );
244typedef CGLError (*CGLGetVirtualScreenFunc_t)( CGLContextObj, long *);
245
246typedef CGLError (*CGLSetOptionFunc_t)( CGLGlobalOption, long );
247typedef CGLError (*CGLGetOptionFunc_t)( CGLGlobalOption, long * );
248typedef void (*CGLGetVersionFunc_t)( long *, long * );
249
250typedef const char * (*CGLErrorStringFunc_t)( CGLError );
251
252/** XXX \todo Undocumented CGL functions. Are these all correct? */
253typedef void *CGSConnectionID;
254typedef int CGSWindowID;
255typedef int CGSSurfaceID;
256
257typedef CGLError (*CGLSetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID );
258typedef CGLError (*CGLGetSurfaceFunc_t)( CGLContextObj, CGSConnectionID, CGSWindowID, CGSSurfaceID* );
259typedef CGLError (*CGLUpdateContextFunc_t)( CGLContextObj );
260/*@}*/
261#else
262/**
263 * X11/GLX
264 */
265/*@{*/
266typedef int (*glXGetConfigFunc_t)( Display *, XVisualInfo *, int, int * );
267typedef Bool (*glXQueryExtensionFunc_t) (Display *, int *, int * );
268typedef const char *(*glXQueryExtensionsStringFunc_t) (Display *, int );
269typedef Bool (*glXQueryVersionFunc_t)( Display *dpy, int *maj, int *min );
270typedef XVisualInfo *(*glXChooseVisualFunc_t)( Display *, int, int * );
271typedef GLXContext (*glXCreateContextFunc_t)( Display *, XVisualInfo *, GLXContext, Bool );
272typedef void (*glXUseXFontFunc_t)(Font font, int first, int count, int listBase);
273typedef void (*glXDestroyContextFunc_t)( Display *, GLXContext );
274typedef Bool (*glXIsDirectFunc_t)( Display *, GLXContext );
275typedef Bool (*glXMakeCurrentFunc_t)( Display *, GLXDrawable, GLXContext );
276typedef void (*glXSwapBuffersFunc_t)( Display *, GLXDrawable );
277typedef CR_GLXFuncPtr (*glXGetProcAddressARBFunc_t)( const GLubyte *name );
278typedef Display *(*glXGetCurrentDisplayFunc_t)( void );
279typedef GLXContext (*glXGetCurrentContextFunc_t)( void );
280typedef GLXDrawable (*glXGetCurrentDrawableFunc_t)( void );
281typedef char * (*glXGetClientStringFunc_t)( Display *dpy, int name );
282typedef void (*glXWaitGLFunc_t)(void);
283typedef void (*glXWaitXFunc_t)(void);
284typedef void (*glXCopyContextFunc_t)(Display *dpy, GLXContext src, GLXContext dst, unsigned long mask );
285typedef const GLubyte *(*glGetStringFunc_t)( GLenum );
286typedef Bool (*glXJoinSwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint group);
287typedef Bool (*glXBindSwapBarrierNVFunc_t)(Display *dpy, GLuint group, GLuint barrier);
288typedef Bool (*glXQuerySwapGroupNVFunc_t)(Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
289typedef Bool (*glXQueryMaxSwapGroupsNVFunc_t)(Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
290typedef Bool (*glXQueryFrameCountNVFunc_t)(Display *dpy, int screen, GLuint *count);
291typedef Bool (*glXResetFrameCountNVFunc_t)(Display *dpy, int screen);
292#ifdef GLX_VERSION_1_3
293typedef GLXContext (*glXCreateNewContextFunc_t)( Display *dpy, GLXFBConfig config, int renderType, GLXContext shareList, Bool direct );
294typedef GLXWindow (*glXCreateWindowFunc_t)(Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
295typedef Bool (*glXMakeContextCurrentFunc_t)( Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx );
296typedef GLXFBConfig *(*glXChooseFBConfigFunc_t)( Display *dpy, int screen, const int *attribList, int *nitems );
297typedef GLXFBConfig *(*glXGetFBConfigsFunc_t)(Display *dpy, int screen, int *nelements);
298typedef int (*glXGetFBConfigAttribFunc_t)(Display *dpy, GLXFBConfig config, int attribute, int *value);
299typedef XVisualInfo *(*glXGetVisualFromFBConfigFunc_t)(Display *dpy, GLXFBConfig config);
300typedef GLXPbuffer (*glXCreatePbufferFunc_t)( Display *dpy, GLXFBConfig config, const int *attribList );
301typedef void (*glXDestroyPbufferFunc_t)( Display *dpy, GLXPbuffer pbuf );
302typedef int (*glXQueryContextFunc_t)(Display *dpy, GLXContext ctx, int attribute, int *value);
303typedef void (*glXQueryDrawableFunc_t)(Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
304#endif /* GLX_VERSION_1_3 */
305/*@}*/
306#endif
307
308
309/**
310 * Package up the WGL/AGL/CGL/GLX function pointers into a struct. We use
311 * this in a few different places.
312 */
313typedef struct {
314#if defined(WINDOWS)
315 wglGetProcAddressFunc_t wglGetProcAddress;
316 wglCreateContextFunc_t wglCreateContext;
317 wglDeleteContextFunc_t wglDeleteContext;
318 wglShareListsFunc_t wglShareLists;
319 wglMakeCurrentFunc_t wglMakeCurrent;
320 wglSwapBuffersFunc_t wglSwapBuffers;
321 wglGetCurrentContextFunc_t wglGetCurrentContext;
322 wglChoosePixelFormatFunc_t wglChoosePixelFormat;
323 wglDescribePixelFormatFunc_t wglDescribePixelFormat;
324 wglSetPixelFormatFunc_t wglSetPixelFormat;
325 wglChoosePixelFormatEXTFunc_t wglChoosePixelFormatEXT;
326 wglGetPixelFormatAttribivEXTFunc_t wglGetPixelFormatAttribivEXT;
327 wglGetPixelFormatAttribfvEXTFunc_t wglGetPixelFormatAttribfvEXT;
328 wglGetExtensionsStringEXTFunc_t wglGetExtensionsStringEXT;
329#elif defined(DARWIN)
330# ifndef VBOX_WITH_COCOA_QT
331 aglCreateContextFunc_t aglCreateContext;
332 aglDestroyContextFunc_t aglDestroyContext;
333 aglSetCurrentContextFunc_t aglSetCurrentContext;
334 aglSwapBuffersFunc_t aglSwapBuffers;
335 aglChoosePixelFormatFunc_t aglChoosePixelFormat;
336 aglDestroyPixelFormatFunc_t aglDestroyPixelFormat;
337 aglDescribePixelFormatFunc_t aglDescribePixelFormat;
338 aglGetCurrentContextFunc_t aglGetCurrentContext;
339 aglSetDrawableFunc_t aglSetDrawable;
340 aglGetDrawableFunc_t aglGetDrawable;
341 aglSetFullScreenFunc_t aglSetFullScreen;
342 aglGetProcAddressFunc_t aglGetProcAddress;
343 aglUpdateContextFunc_t aglUpdateContext;
344 aglUseFontFunc_t aglUseFont;
345 aglSetIntegerFunc_t aglSetInteger;
346 aglGetErrorFunc_t aglGetError;
347 aglGetIntegerFunc_t aglGetInteger;
348 aglEnableFunc_t aglEnable;
349 aglDisableFunc_t aglDisable;
350# endif
351
352 CGLChoosePixelFormatFunc_t CGLChoosePixelFormat;
353 CGLDestroyPixelFormatFunc_t CGLDestroyPixelFormat;
354 CGLDescribePixelFormatFunc_t CGLDescribePixelFormat;
355 CGLQueryRendererInfoFunc_t CGLQueryRendererInfo;
356 CGLDestroyRendererInfoFunc_t CGLDestroyRendererInfo;
357 CGLDescribeRendererFunc_t CGLDescribeRenderer;
358 CGLCreateContextFunc_t CGLCreateContext;
359 CGLDestroyContextFunc_t CGLDestroyContext;
360 CGLCopyContextFunc_t CGLCopyContext;
361 CGLSetCurrentContextFunc_t CGLSetCurrentContext;
362 CGLGetCurrentContextFunc_t CGLGetCurrentContext;
363 CGLCreatePBufferFunc_t CGLCreatePBuffer;
364 CGLDestroyPBufferFunc_t CGLDestroyPBuffer;
365 CGLDescribePBufferFunc_t CGLDescribePBuffer;
366 CGLTexImagePBufferFunc_t CGLTexImagePBuffer;
367 CGLSetOffScreenFunc_t CGLSetOffScreen;
368 CGLGetOffScreenFunc_t CGLGetOffScreen;
369 CGLSetFullScreenFunc_t CGLSetFullScreen;
370 CGLSetPBufferFunc_t CGLSetPBuffer;
371 CGLGetPBufferFunc_t CGLGetPBuffer;
372 CGLClearDrawableFunc_t CGLClearDrawable;
373 CGLFlushDrawableFunc_t CGLFlushDrawable;
374 CGLEnableFunc_t CGLEnable;
375 CGLDisableFunc_t CGLDisable;
376 CGLIsEnabledFunc_t CGLIsEnabled;
377 CGLSetParameterFunc_t CGLSetParameter;
378 CGLGetParameterFunc_t CGLGetParameter;
379 CGLSetVirtualScreenFunc_t CGLSetVirtualScreen;
380 CGLGetVirtualScreenFunc_t CGLGetVirtualScreen;
381 CGLSetOptionFunc_t CGLSetOption;
382 CGLGetOptionFunc_t CGLGetOption;
383 CGLGetVersionFunc_t CGLGetVersion;
384 CGLErrorStringFunc_t CGLErrorString;
385
386 CGLSetSurfaceFunc_t CGLSetSurface;
387 CGLGetSurfaceFunc_t CGLGetSurface;
388 CGLUpdateContextFunc_t CGLUpdateContext;
389#else
390 glXGetConfigFunc_t glXGetConfig;
391 glXQueryExtensionFunc_t glXQueryExtension;
392 glXQueryVersionFunc_t glXQueryVersion;
393 glXQueryExtensionsStringFunc_t glXQueryExtensionsString;
394 glXChooseVisualFunc_t glXChooseVisual;
395 glXCreateContextFunc_t glXCreateContext;
396 glXDestroyContextFunc_t glXDestroyContext;
397 glXUseXFontFunc_t glXUseXFont;
398 glXIsDirectFunc_t glXIsDirect;
399 glXMakeCurrentFunc_t glXMakeCurrent;
400 glXSwapBuffersFunc_t glXSwapBuffers;
401 glXGetProcAddressARBFunc_t glXGetProcAddressARB;
402 glXGetCurrentDisplayFunc_t glXGetCurrentDisplay;
403 glXGetCurrentContextFunc_t glXGetCurrentContext;
404 glXGetCurrentDrawableFunc_t glXGetCurrentDrawable;
405 glXGetClientStringFunc_t glXGetClientString;
406 glXWaitGLFunc_t glXWaitGL;
407 glXWaitXFunc_t glXWaitX;
408 glXCopyContextFunc_t glXCopyContext;
409 /* GLX_NV_swap_group */
410 glXJoinSwapGroupNVFunc_t glXJoinSwapGroupNV;
411 glXBindSwapBarrierNVFunc_t glXBindSwapBarrierNV;
412 glXQuerySwapGroupNVFunc_t glXQuerySwapGroupNV;
413 glXQueryMaxSwapGroupsNVFunc_t glXQueryMaxSwapGroupsNV;
414 glXQueryFrameCountNVFunc_t glXQueryFrameCountNV;
415 glXResetFrameCountNVFunc_t glXResetFrameCountNV;
416#ifdef GLX_VERSION_1_3
417 glXCreateNewContextFunc_t glXCreateNewContext;
418 glXCreateWindowFunc_t glXCreateWindow;
419 glXMakeContextCurrentFunc_t glXMakeContextCurrent;
420 glXChooseFBConfigFunc_t glXChooseFBConfig;
421 glXGetFBConfigsFunc_t glXGetFBConfigs;
422 glXGetFBConfigAttribFunc_t glXGetFBConfigAttrib;
423 glXGetVisualFromFBConfigFunc_t glXGetVisualFromFBConfig;
424 glXCreatePbufferFunc_t glXCreatePbuffer;
425 glXDestroyPbufferFunc_t glXDestroyPbuffer;
426 glXQueryContextFunc_t glXQueryContext;
427 glXQueryDrawableFunc_t glXQueryDrawable;
428#endif
429#endif
430 glGetStringFunc_t glGetString;
431} crOpenGLInterface;
432
433
434/** This is the one required function in _all_ SPUs */
435DECLEXPORT(int) SPULoad( char **name, char **super, SPUInitFuncPtr *init,
436 SPUSelfDispatchFuncPtr *self, SPUCleanupFuncPtr *cleanup,
437 SPUOptionsPtr *options, int *flags );
438
439DECLEXPORT(SPU *) crSPULoad( SPU *child, int id, char *name, char *dir, void *server);
440DECLEXPORT(SPU *) crSPULoadChain( int count, int *ids, char **names, char *dir, void *server );
441DECLEXPORT(void) crSPUUnloadChain(SPU *headSPU);
442
443DECLEXPORT(void) crSPUInitDispatchTable( SPUDispatchTable *table );
444DECLEXPORT(void) crSPUCopyDispatchTable( SPUDispatchTable *dst, SPUDispatchTable *src );
445DECLEXPORT(void) crSPUChangeInterface( SPUDispatchTable *table, void *origFunc, void *newFunc );
446
447
448DECLEXPORT(void) crSPUSetDefaultParams( void *spu, SPUOptions *options );
449DECLEXPORT(int) crSPUGetEnumIndex( const SPUOptions *option, const char *optName, const char *value );
450
451
452DECLEXPORT(SPUGenericFunction) crSPUFindFunction( const SPUNamedFunctionTable *table, const char *fname );
453DECLEXPORT(void) crSPUInitDispatch( SPUDispatchTable *dispatch, const SPUNamedFunctionTable *table );
454DECLEXPORT(void) crSPUInitDispatchNops(SPUDispatchTable *table);
455
456DECLEXPORT(int) crLoadOpenGL( crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
457DECLEXPORT(void) crUnloadOpenGL( void );
458DECLEXPORT(int) crLoadOpenGLExtensions( const crOpenGLInterface *crInterface, SPUNamedFunctionTable table[] );
459DECLEXPORT(void) crSPUChangeDispatch(SPUDispatchTable *dispatch, const SPUNamedFunctionTable *newtable);
460
461#if defined(GLX)
462DECLEXPORT(XVisualInfo *)
463crChooseVisual(const crOpenGLInterface *ws, Display *dpy, int screen,
464 GLboolean directColor, int visBits);
465#else
466DECLEXPORT(int)
467crChooseVisual(const crOpenGLInterface *ws, int visBits);
468#endif
469
470
471#ifdef USE_OSMESA
472DECLEXPORT(int)
473crLoadOSMesa( OSMesaContext (**createContext)( GLenum format, OSMesaContext sharelist ),
474 GLboolean (**makeCurrent)( OSMesaContext ctx, GLubyte *buffer,
475 GLenum type, GLsizei width, GLsizei height ),
476 void (**destroyContext)( OSMesaContext ctx ));
477#endif
478
479#ifdef __cplusplus
480}
481#endif
482
483#endif /* CR_SPU_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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