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 |
|
---|
7 | #ifndef CR_RENDERSPU_H
|
---|
8 | #define CR_RENDERSPU_H
|
---|
9 |
|
---|
10 | #ifdef WINDOWS
|
---|
11 | #define WIN32_LEAN_AND_MEAN
|
---|
12 | #include <windows.h>
|
---|
13 | #define RENDER_APIENTRY __stdcall
|
---|
14 | #define snprintf _snprintf
|
---|
15 | #elif defined(DARWIN)
|
---|
16 | # ifndef VBOX_WITH_COCOA_QT
|
---|
17 | # include <AGL/AGL.h>
|
---|
18 | # else
|
---|
19 | # include "renderspu_cocoa_helper.h"
|
---|
20 | # endif
|
---|
21 | #define RENDER_APIENTRY
|
---|
22 | #else
|
---|
23 | #include <GL/glx.h>
|
---|
24 | #define RENDER_APIENTRY
|
---|
25 | #endif
|
---|
26 | #include "cr_threads.h"
|
---|
27 | #include "cr_spu.h"
|
---|
28 | #include "cr_hash.h"
|
---|
29 | #include "cr_server.h"
|
---|
30 | #include "cr_blitter.h"
|
---|
31 | #include "cr_compositor.h"
|
---|
32 |
|
---|
33 | #include <iprt/cdefs.h>
|
---|
34 | #include <iprt/critsect.h>
|
---|
35 | #if defined(GLX) /* @todo: unify windows and glx thread creation code */
|
---|
36 | #include <iprt/thread.h>
|
---|
37 | #include <iprt/semaphore.h>
|
---|
38 |
|
---|
39 | /* special window id used for representing the command window CRWindowInfo */
|
---|
40 | #define CR_RENDER_WINCMD_ID (INT32_MAX-2)
|
---|
41 | AssertCompile(CR_RENDER_WINCMD_ID != CR_RENDER_DEFAULT_WINDOW_ID);
|
---|
42 | /* CRHashTable is using unsigned long keys, we use it to trore X Window -> CRWindowInfo association */
|
---|
43 | AssertCompile(sizeof (Window) == sizeof (unsigned long));
|
---|
44 | #endif
|
---|
45 |
|
---|
46 |
|
---|
47 | #define MAX_VISUALS 32
|
---|
48 |
|
---|
49 | #ifdef RT_OS_DARWIN
|
---|
50 | # ifndef VBOX_WITH_COCOA_QT
|
---|
51 | enum
|
---|
52 | {
|
---|
53 | /* Event classes */
|
---|
54 | kEventClassVBox = 'vbox',
|
---|
55 | /* Event kinds */
|
---|
56 | kEventVBoxShowWindow = 'swin',
|
---|
57 | kEventVBoxHideWindow = 'hwin',
|
---|
58 | kEventVBoxMoveWindow = 'mwin',
|
---|
59 | kEventVBoxResizeWindow = 'rwin',
|
---|
60 | kEventVBoxDisposeWindow = 'dwin',
|
---|
61 | kEventVBoxUpdateDock = 'udck',
|
---|
62 | kEventVBoxUpdateContext = 'uctx',
|
---|
63 | kEventVBoxBoundsChanged = 'bchg'
|
---|
64 | };
|
---|
65 | pascal OSStatus windowEvtHndlr(EventHandlerCallRef myHandler, EventRef event, void* userData);
|
---|
66 | # endif
|
---|
67 | #endif /* RT_OS_DARWIN */
|
---|
68 |
|
---|
69 | /**
|
---|
70 | * Visual info
|
---|
71 | */
|
---|
72 | typedef struct {
|
---|
73 | GLbitfield visAttribs;
|
---|
74 | const char *displayName;
|
---|
75 | #if defined(WINDOWS)
|
---|
76 | // HDC device_context;
|
---|
77 | #elif defined(DARWIN)
|
---|
78 | # ifndef VBOX_WITH_COCOA_QT
|
---|
79 | WindowRef window;
|
---|
80 | # endif
|
---|
81 | #elif defined(GLX)
|
---|
82 | Display *dpy;
|
---|
83 | XVisualInfo *visual;
|
---|
84 | #ifdef GLX_VERSION_1_3
|
---|
85 | GLXFBConfig fbconfig;
|
---|
86 | #endif /* GLX_VERSION_1_3 */
|
---|
87 | #endif
|
---|
88 | } VisualInfo;
|
---|
89 |
|
---|
90 | /**
|
---|
91 | * Window info
|
---|
92 | */
|
---|
93 | typedef struct WindowInfo {
|
---|
94 | int x, y;
|
---|
95 | // int width, height;
|
---|
96 | // int id; /**< integer window ID */
|
---|
97 | CR_BLITTER_WINDOW BltInfo;
|
---|
98 |
|
---|
99 | VisualInfo *visual;
|
---|
100 | GLboolean mapPending;
|
---|
101 | GLboolean visible;
|
---|
102 | GLboolean everCurrent; /**< has this window ever been bound? */
|
---|
103 | GLboolean fCompositorPresentEmpty;
|
---|
104 | char *title;
|
---|
105 |
|
---|
106 | const VBOXVR_SCR_COMPOSITOR *pCompositor;
|
---|
107 | /* the composotor lock is used to synchronize the current compositor access,
|
---|
108 | * i.e. the compositor can be accessed by a gui refraw thread,
|
---|
109 | * while chromium thread might try to set a new compositor
|
---|
110 | * note that the compositor internally has its own lock to be used for accessing its data
|
---|
111 | * see CrVrScrCompositorLock/Unlock; renderspu and crserverlib would use it for compositor data access */
|
---|
112 | RTCRITSECT CompositorLock;
|
---|
113 | PCR_BLITTER pBlitter;
|
---|
114 | #if defined(WINDOWS)
|
---|
115 | HDC nativeWindow; /**< for render_to_app_window */
|
---|
116 | HWND hWnd;
|
---|
117 | HDC device_context;
|
---|
118 | HDC redraw_device_context;
|
---|
119 | HRGN hRgn;
|
---|
120 | #elif defined(DARWIN)
|
---|
121 | # ifndef VBOX_WITH_COCOA_QT
|
---|
122 | WindowRef window;
|
---|
123 | WindowRef nativeWindow; /**< for render_to_app_window */
|
---|
124 | WindowRef appWindow;
|
---|
125 | EventHandlerUPP event_handler;
|
---|
126 | GLint bufferName;
|
---|
127 | AGLContext dummyContext;
|
---|
128 | RgnHandle hVisibleRegion;
|
---|
129 | /* unsigned long context_ptr; */
|
---|
130 | # else
|
---|
131 | NativeNSViewRef window;
|
---|
132 | NativeNSViewRef nativeWindow; /**< for render_to_app_window */
|
---|
133 | NativeNSOpenGLContextRef *currentCtx;
|
---|
134 | # endif
|
---|
135 | #elif defined(GLX)
|
---|
136 | Window window;
|
---|
137 | Window nativeWindow; /**< for render_to_app_window */
|
---|
138 | Window appWindow; /**< Same as nativeWindow but for garbage collections purposes */
|
---|
139 | #endif
|
---|
140 | int nvSwapGroup;
|
---|
141 |
|
---|
142 | #ifdef USE_OSMESA
|
---|
143 | GLubyte *buffer; /**< for rendering to off screen buffer. */
|
---|
144 | int in_buffer_width;
|
---|
145 | int in_buffer_height;
|
---|
146 | #endif
|
---|
147 |
|
---|
148 | } WindowInfo;
|
---|
149 |
|
---|
150 | /**
|
---|
151 | * Context Info
|
---|
152 | */
|
---|
153 | typedef struct _ContextInfo {
|
---|
154 | // int id; /**< integer context ID */
|
---|
155 | CR_BLITTER_CONTEXT BltInfo;
|
---|
156 | VisualInfo *visual;
|
---|
157 | GLboolean everCurrent;
|
---|
158 | GLboolean haveWindowPosARB;
|
---|
159 | WindowInfo *currentWindow;
|
---|
160 | #if defined(WINDOWS)
|
---|
161 | HGLRC hRC;
|
---|
162 | #elif defined(DARWIN)
|
---|
163 | # ifndef VBOX_WITH_COCOA_QT
|
---|
164 | AGLContext context;
|
---|
165 | # else
|
---|
166 | NativeNSOpenGLContextRef context;
|
---|
167 | # endif
|
---|
168 | #elif defined(GLX)
|
---|
169 | GLXContext context;
|
---|
170 | #endif
|
---|
171 | struct _ContextInfo *shared;
|
---|
172 | char *extensionString;
|
---|
173 | volatile uint32_t cRefs;
|
---|
174 | } ContextInfo;
|
---|
175 |
|
---|
176 | /**
|
---|
177 | * Barrier info
|
---|
178 | */
|
---|
179 | typedef struct {
|
---|
180 | CRbarrier barrier;
|
---|
181 | GLuint count;
|
---|
182 | } Barrier;
|
---|
183 |
|
---|
184 | #ifdef GLX
|
---|
185 | typedef enum
|
---|
186 | {
|
---|
187 | CR_RENDER_WINCMD_TYPE_UNDEFINED = 0,
|
---|
188 | /* create the window (not used for now) */
|
---|
189 | CR_RENDER_WINCMD_TYPE_WIN_CREATE,
|
---|
190 | /* destroy the window (not used for now) */
|
---|
191 | CR_RENDER_WINCMD_TYPE_WIN_DESTROY,
|
---|
192 | /* notify the WinCmd thread about window creation */
|
---|
193 | CR_RENDER_WINCMD_TYPE_WIN_ON_CREATE,
|
---|
194 | /* notify the WinCmd thread about window destroy */
|
---|
195 | CR_RENDER_WINCMD_TYPE_WIN_ON_DESTROY,
|
---|
196 | /* nop used to synchronize with the WinCmd thread */
|
---|
197 | CR_RENDER_WINCMD_TYPE_NOP,
|
---|
198 | /* exit Win Cmd thread */
|
---|
199 | CR_RENDER_WINCMD_TYPE_EXIT,
|
---|
200 | } CR_RENDER_WINCMD_TYPE;
|
---|
201 |
|
---|
202 | typedef struct CR_RENDER_WINCMD
|
---|
203 | {
|
---|
204 | /* command type */
|
---|
205 | CR_RENDER_WINCMD_TYPE enmCmd;
|
---|
206 | /* command result */
|
---|
207 | int rc;
|
---|
208 | /* valid for WIN_CREATE & WIN_DESTROY only */
|
---|
209 | WindowInfo *pWindow;
|
---|
210 | } CR_RENDER_WINCMD, *PCR_RENDER_WINCMD;
|
---|
211 | #endif
|
---|
212 |
|
---|
213 | #ifdef RT_OS_DARWIN
|
---|
214 | typedef void (*PFNDELETE_OBJECT)(GLhandleARB obj);
|
---|
215 | typedef void (*PFNGET_ATTACHED_OBJECTS)( GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, GLhandleARB * obj );
|
---|
216 | typedef GLhandleARB (*PFNGET_HANDLE)(GLenum pname);
|
---|
217 | typedef void (*PFNGET_INFO_LOG)( GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog );
|
---|
218 | typedef void (*PFNGET_OBJECT_PARAMETERFV)( GLhandleARB obj, GLenum pname, GLfloat * params );
|
---|
219 | typedef void (*PFNGET_OBJECT_PARAMETERIV)( GLhandleARB obj, GLenum pname, GLint * params );
|
---|
220 | #endif
|
---|
221 |
|
---|
222 | /**
|
---|
223 | * Renderspu state info
|
---|
224 | */
|
---|
225 | typedef struct {
|
---|
226 | SPUDispatchTable self;
|
---|
227 | int id;
|
---|
228 |
|
---|
229 | /** config options */
|
---|
230 | /*@{*/
|
---|
231 | char *window_title;
|
---|
232 | int defaultX, defaultY;
|
---|
233 | unsigned int defaultWidth, defaultHeight;
|
---|
234 | int default_visual;
|
---|
235 | int use_L2;
|
---|
236 | int fullscreen, ontop;
|
---|
237 | char display_string[100];
|
---|
238 | #if defined(GLX)
|
---|
239 | int try_direct;
|
---|
240 | int force_direct;
|
---|
241 | int sync;
|
---|
242 | #endif
|
---|
243 | int render_to_app_window;
|
---|
244 | int render_to_crut_window;
|
---|
245 | int crut_drawable;
|
---|
246 | int resizable;
|
---|
247 | int use_lut8, lut8[3][256];
|
---|
248 | int borderless;
|
---|
249 | int nvSwapGroup;
|
---|
250 | int ignore_papi;
|
---|
251 | int ignore_window_moves;
|
---|
252 | int pbufferWidth, pbufferHeight;
|
---|
253 | int use_glxchoosevisual;
|
---|
254 | int draw_bbox;
|
---|
255 | /*@}*/
|
---|
256 |
|
---|
257 | CRServer *server;
|
---|
258 | int gather_port;
|
---|
259 | int gather_userbuf_size;
|
---|
260 | CRConnection **gather_conns;
|
---|
261 |
|
---|
262 | GLint drawCursor;
|
---|
263 | GLint cursorX, cursorY;
|
---|
264 |
|
---|
265 | int numVisuals;
|
---|
266 | VisualInfo visuals[MAX_VISUALS];
|
---|
267 |
|
---|
268 | CRHashTable *windowTable;
|
---|
269 | CRHashTable *contextTable;
|
---|
270 |
|
---|
271 | CRHashTable *dummyWindowTable;
|
---|
272 |
|
---|
273 | ContextInfo *defaultSharedContext;
|
---|
274 |
|
---|
275 | #ifndef CHROMIUM_THREADSAFE
|
---|
276 | ContextInfo *currentContext;
|
---|
277 | #endif
|
---|
278 |
|
---|
279 | crOpenGLInterface ws; /**< Window System interface */
|
---|
280 |
|
---|
281 | CRHashTable *barrierHash;
|
---|
282 |
|
---|
283 | int is_swap_master, num_swap_clients;
|
---|
284 | int swap_mtu;
|
---|
285 | char *swap_master_url;
|
---|
286 | CRConnection **swap_conns;
|
---|
287 |
|
---|
288 | SPUDispatchTable blitterDispatch;
|
---|
289 | CRHashTable *blitterTable;
|
---|
290 |
|
---|
291 | #ifdef USE_OSMESA
|
---|
292 | /** Off screen rendering hooks. */
|
---|
293 | int use_osmesa;
|
---|
294 |
|
---|
295 | OSMesaContext (*OSMesaCreateContext)( GLenum format, OSMesaContext sharelist );
|
---|
296 | GLboolean (* OSMesaMakeCurrent)( OSMesaContext ctx,
|
---|
297 | GLubyte *buffer,
|
---|
298 | GLenum type,
|
---|
299 | GLsizei width,
|
---|
300 | GLsizei height );
|
---|
301 | void (*OSMesaDestroyContext)( OSMesaContext ctx );
|
---|
302 | #endif
|
---|
303 |
|
---|
304 | #if defined(GLX)
|
---|
305 | RTTHREAD hWinCmdThread;
|
---|
306 | VisualInfo WinCmdVisual;
|
---|
307 | WindowInfo WinCmdWindow;
|
---|
308 | RTSEMEVENT hWinCmdCompleteEvent;
|
---|
309 | /* display connection used to send data to the WinCmd thread */
|
---|
310 | Display *pCommunicationDisplay;
|
---|
311 | Atom WinCmdAtom;
|
---|
312 | /* X Window -> CRWindowInfo table */
|
---|
313 | CRHashTable *pWinToInfoTable;
|
---|
314 | #endif
|
---|
315 |
|
---|
316 | #ifdef RT_OS_WINDOWS
|
---|
317 | DWORD dwWinThreadId;
|
---|
318 | HANDLE hWinThreadReadyEvent;
|
---|
319 | #endif
|
---|
320 |
|
---|
321 | #ifdef RT_OS_DARWIN
|
---|
322 | # ifdef VBOX_WITH_COCOA_QT
|
---|
323 | PFNDELETE_OBJECT pfnDeleteObject;
|
---|
324 | PFNGET_ATTACHED_OBJECTS pfnGetAttachedObjects;
|
---|
325 | PFNGET_HANDLE pfnGetHandle;
|
---|
326 | PFNGET_INFO_LOG pfnGetInfoLog;
|
---|
327 | PFNGET_OBJECT_PARAMETERFV pfnGetObjectParameterfv;
|
---|
328 | PFNGET_OBJECT_PARAMETERIV pfnGetObjectParameteriv;
|
---|
329 |
|
---|
330 | CR_GLSL_CACHE GlobalShaders;
|
---|
331 | # else
|
---|
332 | RgnHandle hRootVisibleRegion;
|
---|
333 | RTSEMFASTMUTEX syncMutex;
|
---|
334 | EventHandlerUPP hParentEventHandler;
|
---|
335 | WindowGroupRef pParentGroup;
|
---|
336 | WindowGroupRef pMasterGroup;
|
---|
337 | GLint currentBufferName;
|
---|
338 | uint64_t uiDockUpdateTS;
|
---|
339 | bool fInit;
|
---|
340 | # endif
|
---|
341 | #endif /* RT_OS_DARWIN */
|
---|
342 | } RenderSPU;
|
---|
343 |
|
---|
344 | #ifdef RT_OS_WINDOWS
|
---|
345 |
|
---|
346 | /* Asks window thread to create new window.
|
---|
347 | msg.lParam - holds pointer to CREATESTRUCT structure
|
---|
348 | note that lpCreateParams is used to specify address to store handle of created window
|
---|
349 | msg.wParam - unused, should be NULL
|
---|
350 | */
|
---|
351 | #define WM_VBOX_RENDERSPU_CREATE_WINDOW (WM_APP+1)
|
---|
352 |
|
---|
353 | typedef struct _VBOX_RENDERSPU_DESTROY_WINDOW {
|
---|
354 | HWND hWnd; /* handle to window to destroy */
|
---|
355 | } VBOX_RENDERSPU_DESTROY_WINDOW;
|
---|
356 |
|
---|
357 | /* Asks window thread to destroy previously created window.
|
---|
358 | msg.lParam - holds pointer to RENDERSPU_VBOX_WINDOW_DESTROY structure
|
---|
359 | msg.wParam - unused, should be NULL
|
---|
360 | */
|
---|
361 | #define WM_VBOX_RENDERSPU_DESTROY_WINDOW (WM_APP+2)
|
---|
362 |
|
---|
363 | #endif
|
---|
364 |
|
---|
365 | extern RenderSPU render_spu;
|
---|
366 |
|
---|
367 | /* @todo remove this hack */
|
---|
368 | extern uint64_t render_spu_parent_window_id;
|
---|
369 |
|
---|
370 | #ifdef CHROMIUM_THREADSAFE
|
---|
371 | extern CRtsd _RenderTSD;
|
---|
372 | #define GET_CONTEXT_VAL() ((ContextInfo *) crGetTSD(&_RenderTSD))
|
---|
373 | #define SET_CONTEXT_VAL(_v) do { \
|
---|
374 | crSetTSD(&_RenderTSD, (_v)); \
|
---|
375 | } while (0)
|
---|
376 | #else
|
---|
377 | #define GET_CONTEXT_VAL() (render_spu.currentContext)
|
---|
378 | #define SET_CONTEXT_VAL(_v) do { \
|
---|
379 | render_spu.currentContext = (_v); \
|
---|
380 | } while (0)
|
---|
381 |
|
---|
382 | #endif
|
---|
383 |
|
---|
384 | #define GET_CONTEXT(T) ContextInfo *T = GET_CONTEXT_VAL()
|
---|
385 |
|
---|
386 |
|
---|
387 | extern void renderspuSetDefaultSharedContext(ContextInfo *pCtx);
|
---|
388 | extern void renderspuSetVBoxConfiguration( RenderSPU *spu );
|
---|
389 | extern void renderspuMakeVisString( GLbitfield visAttribs, char *s );
|
---|
390 | extern VisualInfo *renderspuFindVisual(const char *displayName, GLbitfield visAttribs );
|
---|
391 | extern GLboolean renderspu_SystemInitVisual( VisualInfo *visual );
|
---|
392 | extern GLboolean renderspu_SystemCreateContext( VisualInfo *visual, ContextInfo *context, ContextInfo *sharedContext );
|
---|
393 | extern void renderspu_SystemDestroyContext( ContextInfo *context );
|
---|
394 | extern GLboolean renderspu_SystemCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window );
|
---|
395 | extern GLboolean renderspu_SystemVBoxCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window );
|
---|
396 | extern void renderspu_SystemDestroyWindow( WindowInfo *window );
|
---|
397 | extern void renderspu_SystemWindowSize( WindowInfo *window, GLint w, GLint h );
|
---|
398 | extern void renderspu_SystemGetWindowGeometry( WindowInfo *window, GLint *x, GLint *y, GLint *w, GLint *h );
|
---|
399 | extern void renderspu_SystemGetMaxWindowSize( WindowInfo *window, GLint *w, GLint *h );
|
---|
400 | extern void renderspu_SystemWindowPosition( WindowInfo *window, GLint x, GLint y );
|
---|
401 | extern void renderspu_SystemWindowVisibleRegion(WindowInfo *window, GLint cRects, const GLint* pRects);
|
---|
402 | extern int renderspu_SystemInit();
|
---|
403 | extern int renderspu_SystemTerm();
|
---|
404 | extern void renderspu_SystemDefaultSharedContextChanged(ContextInfo *fromContext, ContextInfo *toContext);
|
---|
405 | extern void renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt );
|
---|
406 | extern void renderspu_SystemMakeCurrent( WindowInfo *window, GLint windowInfor, ContextInfo *context );
|
---|
407 | extern void renderspu_SystemSwapBuffers( WindowInfo *window, GLint flags );
|
---|
408 | extern void renderspu_SystemReparentWindow(WindowInfo *window);
|
---|
409 | extern void renderspu_SystemVBoxPresentComposition( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry );
|
---|
410 | uint32_t renderspu_SystemPostprocessFunctions(SPUNamedFunctionTable *aFunctions, uint32_t cFunctions, uint32_t cTable);
|
---|
411 | extern void renderspu_GCWindow(void);
|
---|
412 | extern int renderspuCreateFunctions( SPUNamedFunctionTable table[] );
|
---|
413 | extern void renderspuVBoxCompositorSet( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor);
|
---|
414 | extern void renderspuVBoxCompositorClearAll();
|
---|
415 | extern int renderspuVBoxCompositorLock(WindowInfo *window);
|
---|
416 | extern int renderspuVBoxCompositorUnlock(WindowInfo *window);
|
---|
417 | extern const struct VBOXVR_SCR_COMPOSITOR * renderspuVBoxCompositorAcquire( WindowInfo *window);
|
---|
418 | extern int renderspuVBoxCompositorTryAcquire(WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR **ppCompositor);
|
---|
419 | extern void renderspuVBoxCompositorRelease( WindowInfo *window);
|
---|
420 | extern void renderspuVBoxPresentCompositionGeneric( WindowInfo *window, const struct VBOXVR_SCR_COMPOSITOR * pCompositor,
|
---|
421 | const struct VBOXVR_SCR_COMPOSITOR_ENTRY *pChangedEntry, int32_t i32MakeCurrentUserData,
|
---|
422 | bool fRedraw);
|
---|
423 | extern PCR_BLITTER renderspuVBoxPresentBlitterGet( WindowInfo *window );
|
---|
424 | void renderspuVBoxPresentBlitterCleanup( WindowInfo *window );
|
---|
425 | extern int renderspuVBoxPresentBlitterEnter( PCR_BLITTER pBlitter, int32_t i32MakeCurrentUserData );
|
---|
426 | extern PCR_BLITTER renderspuVBoxPresentBlitterGetAndEnter( WindowInfo *window, int32_t i32MakeCurrentUserData, bool fRedraw );
|
---|
427 | extern PCR_BLITTER renderspuVBoxPresentBlitterEnsureCreated( WindowInfo *window, int32_t i32MakeCurrentUserData );
|
---|
428 | void renderspuWindowTermBase( WindowInfo *window );
|
---|
429 | extern void renderspuWindowTerm( WindowInfo *window );
|
---|
430 | extern WindowInfo* renderspuGetDummyWindow(GLint visBits);
|
---|
431 | extern void renderspuPerformMakeCurrent(WindowInfo *window, GLint nativeWindow, ContextInfo *context);
|
---|
432 | extern GLboolean renderspuWindowInit(WindowInfo *pWindow, const char *dpyName, GLint visBits, GLint id);
|
---|
433 | extern GLboolean renderspuWindowInitWithVisual( WindowInfo *window, VisualInfo *visual, GLboolean showIt, GLint id );
|
---|
434 | extern GLboolean renderspuInitVisual(VisualInfo *pVisInfo, const char *displayName, GLbitfield visAttribs);
|
---|
435 | extern void renderspuVBoxCompositorBlit ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter);
|
---|
436 | extern void renderspuVBoxCompositorBlitStretched ( const struct VBOXVR_SCR_COMPOSITOR * pCompositor, PCR_BLITTER pBlitter, GLfloat scaleX, GLfloat scaleY);
|
---|
437 | extern GLint renderspuCreateContextEx(const char *dpyName, GLint visBits, GLint id, GLint shareCtx);
|
---|
438 | extern GLint renderspuWindowCreateEx( const char *dpyName, GLint visBits, GLint id );
|
---|
439 |
|
---|
440 | extern GLint RENDER_APIENTRY renderspuWindowCreate( const char *dpyName, GLint visBits );
|
---|
441 | void RENDER_APIENTRY renderspuWindowDestroy( GLint win );
|
---|
442 | extern GLint RENDER_APIENTRY renderspuCreateContext( const char *dpyname, GLint visBits, GLint shareCtx );
|
---|
443 | extern void RENDER_APIENTRY renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx);
|
---|
444 | extern void RENDER_APIENTRY renderspuSwapBuffers( GLint window, GLint flags );
|
---|
445 |
|
---|
446 | extern uint32_t renderspuContextMarkDeletedAndRelease( ContextInfo *context );
|
---|
447 |
|
---|
448 | int renderspuDefaultCtxInit();
|
---|
449 | void renderspuCleanupBase(bool fDeleteTables);
|
---|
450 |
|
---|
451 | ContextInfo * renderspuDefaultSharedContextAcquire();
|
---|
452 | void renderspuDefaultSharedContextRelease(ContextInfo * pCtx);
|
---|
453 | uint32_t renderspuContextRelease(ContextInfo *context);
|
---|
454 | uint32_t renderspuContextRetain(ContextInfo *context);
|
---|
455 |
|
---|
456 | #ifdef __cplusplus
|
---|
457 | extern "C" {
|
---|
458 | #endif
|
---|
459 | DECLEXPORT(void) renderspuSetWindowId(uint64_t winId);
|
---|
460 | DECLEXPORT(void) renderspuReparentWindow(GLint window);
|
---|
461 | #ifdef __cplusplus
|
---|
462 | }
|
---|
463 | #endif
|
---|
464 |
|
---|
465 | #endif /* CR_RENDERSPU_H */
|
---|