renderspu.h revision 61616cc95539aaed1097893fcba5cd5300ce3ed2
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/* Copyright (c) 2001, Stanford University
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * All rights reserved.
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * See the file LICENSE.txt for information on redistributing this software.
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /* Event classes */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /* Event kinds */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncpascal OSStatus windowEvtHndlr(EventHandlerCallRef myHandler, EventRef event, void* userData);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* RT_OS_DARWIN */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Visual info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* GLX_VERSION_1_3 */
9f9f83ee5948916d644046a79836873db40bfc88vboxsync * Window info
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsynctypedef struct {
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync GLboolean everCurrent; /**< has this window ever been bound? */
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync WindowRef nativeWindow; /**< for render_to_app_window */
9f9f83ee5948916d644046a79836873db40bfc88vboxsync /* unsigned long context_ptr; */
9f9f83ee5948916d644046a79836873db40bfc88vboxsync NativeViewRef nativeWindow; /**< for render_to_app_window */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync Window nativeWindow; /**< for render_to_app_window */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync Window appWindow; /**< Same as nativeWindow but for garbage collections purposes */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLubyte *buffer; /**< for rendering to off screen buffer. */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Context Info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct _ContextInfo {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Barrier info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Renderspu state info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync unsigned int window_id;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync unsigned int context_id;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /** config options */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#if defined(GLX)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync crOpenGLInterface ws; /**< Window System interface */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /** Off screen rendering hooks. */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync OSMesaContext (*OSMesaCreateContext)( GLenum format, OSMesaContext sharelist );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLboolean (* OSMesaMakeCurrent)( OSMesaContext ctx,
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* RT_OS_DARWIN */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/* Asks window thread to create new window.
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync msg.lParam - holds pointer to CREATESTRUCT structure
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync note that lpCreateParams is used to specify address to store handle of created window
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync msg.wParam - unused, should be NULL
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/* Asks window thread to destroy previously created window.
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync msg.lParam - holds pointer to RENDERSPU_VBOX_WINDOW_DESTROY structure
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync msg.wParam - unused, should be NULL
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/* @todo remove this hack */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define GET_CONTEXT(T) ContextInfo *T = (ContextInfo *) crGetTSD(&_RenderTSD)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define GET_CONTEXT(T) ContextInfo *T = render_spu.currentContext
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspuSetVBoxConfiguration( RenderSPU *spu );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspuMakeVisString( GLbitfield visAttribs, char *s );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern VisualInfo *renderspuFindVisual(const char *displayName, GLbitfield visAttribs );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern GLboolean renderspu_SystemInitVisual( VisualInfo *visual );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern GLboolean renderspu_SystemCreateContext( VisualInfo *visual, ContextInfo *context, ContextInfo *sharedContext );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemDestroyContext( ContextInfo *context );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern GLboolean renderspu_SystemCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window );
dcba8de9fb9216170ee6740b57a51b3c8f2a55fcvboxsyncextern GLboolean renderspu_SystemVBoxCreateWindow( VisualInfo *visual, GLboolean showIt, WindowInfo *window );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemDestroyWindow( WindowInfo *window );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemWindowSize( WindowInfo *window, GLint w, GLint h );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemGetWindowGeometry( WindowInfo *window, GLint *x, GLint *y, GLint *w, GLint *h );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemGetMaxWindowSize( WindowInfo *window, GLint *w, GLint *h );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemWindowPosition( WindowInfo *window, GLint x, GLint y );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemWindowVisibleRegion(WindowInfo *window, GLint cRects, GLint* pRects);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemWindowApplyVisibleRegion(WindowInfo *window);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemSetRootVisibleRegion(GLint cRects, GLint *pRects);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemBindFramebufferEXT(GLenum target, GLuint framebuffer);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemShowWindow( WindowInfo *window, GLboolean showIt );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemMakeCurrent( WindowInfo *window, GLint windowInfor, ContextInfo *context );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemSwapBuffers( WindowInfo *window, GLint flags );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemReparentWindow(WindowInfo *window);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_GCWindow(void);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern int renderspuCreateFunctions( SPUNamedFunctionTable table[] );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern GLint RENDER_APIENTRY renderspuWindowCreate( const char *dpyName, GLint visBits );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern GLint RENDER_APIENTRY renderspuCreateContext( const char *dpyname, GLint visBits, GLint shareCtx );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void RENDER_APIENTRY renderspuMakeCurrent(GLint crWindow, GLint nativeWindow, GLint ctx);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void RENDER_APIENTRY renderspuSwapBuffers( GLint window, GLint flags );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern "C" {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncDECLEXPORT(void) renderspuSetWindowId(uint64_t winId);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncDECLEXPORT(void) renderspuSetRootVisibleRegion(GLint cRects, GLint *pRects);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncDECLEXPORT(void) renderspuReparentWindow(GLint window);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* CR_RENDERSPU_H */