renderspu.h revision 61616cc95539aaed1097893fcba5cd5300ce3ed2
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/* Copyright (c) 2001, Stanford University
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * All rights reserved.
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync *
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * See the file LICENSE.txt for information on redistributing this software.
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifndef CR_RENDERSPU_H
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define CR_RENDERSPU_H
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef WINDOWS
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define WIN32_LEAN_AND_MEAN
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include <windows.h>
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define RENDER_APIENTRY __stdcall
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#elif defined(DARWIN)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# ifndef VBOX_WITH_COCOA_QT
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# include <AGL/AGL.h>
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# else
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# include "renderspu_cocoa_helper.h"
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define RENDER_APIENTRY
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#else
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include <GL/glx.h>
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define RENDER_APIENTRY
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include "cr_threads.h"
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include "cr_spu.h"
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include "cr_hash.h"
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include "cr_server.h"
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#include <iprt/cdefs.h>
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define MAX_VISUALS 32
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef RT_OS_DARWIN
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# ifndef VBOX_WITH_COCOA_QT
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncenum
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync{
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /* Event classes */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventClassVBox = 'vbox',
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /* Event kinds */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventVBoxShowWindow = 'swin',
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync kEventVBoxHideWindow = 'hwin',
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventVBoxMoveWindow = 'mwin',
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventVBoxResizeWindow = 'rwin',
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventVBoxDisposeWindow = 'dwin',
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventVBoxUpdateDock = 'udck',
3b9591b897f4b581f0be311535f93fd3a555c576vboxsync kEventVBoxUpdateContext = 'uctx',
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync kEventVBoxBoundsChanged = 'bchg'
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync};
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncpascal OSStatus windowEvtHndlr(EventHandlerCallRef myHandler, EventRef event, void* userData);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* RT_OS_DARWIN */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/**
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Visual info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLbitfield visAttribs;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync const char *displayName;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#if defined(WINDOWS)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync HDC device_context;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#elif defined(DARWIN)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# ifndef VBOX_WITH_COCOA_QT
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync WindowRef window;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#elif defined(GLX)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync Display *dpy;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync XVisualInfo *visual;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef GLX_VERSION_1_3
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLXFBConfig fbconfig;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* GLX_VERSION_1_3 */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync} VisualInfo;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync/**
9f9f83ee5948916d644046a79836873db40bfc88vboxsync * Window info
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync */
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int x, y;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int width, height;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int id; /**< integer window ID */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync VisualInfo *visual;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLboolean mapPending;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync GLboolean visible;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync GLboolean everCurrent; /**< has this window ever been bound? */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync char *title;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#if defined(WINDOWS)
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync HDC nativeWindow; /**< for render_to_app_window */
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync HWND hWnd;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync HDC device_context;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync#elif defined(DARWIN)
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync# ifndef VBOX_WITH_COCOA_QT
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync WindowRef window;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync WindowRef nativeWindow; /**< for render_to_app_window */
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync WindowRef appWindow;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync EventHandlerUPP event_handler;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync GLint bufferName;
9f9f83ee5948916d644046a79836873db40bfc88vboxsync AGLContext dummyContext;
9f9f83ee5948916d644046a79836873db40bfc88vboxsync RgnHandle hVisibleRegion;
9f9f83ee5948916d644046a79836873db40bfc88vboxsync /* unsigned long context_ptr; */
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync# else
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync NativeViewRef window;
9f9f83ee5948916d644046a79836873db40bfc88vboxsync NativeViewRef nativeWindow; /**< for render_to_app_window */
9f9f83ee5948916d644046a79836873db40bfc88vboxsync NativeGLCtxRef *currentCtx;
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#elif defined(GLX)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync Window window;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync Window nativeWindow; /**< for render_to_app_window */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync Window appWindow; /**< Same as nativeWindow but for garbage collections purposes */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int nvSwapGroup;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef USE_OSMESA
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLubyte *buffer; /**< for rendering to off screen buffer. */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int in_buffer_width;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int in_buffer_height;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync} WindowInfo;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
e554e8c589d84d4df49504e096f81dfa48c2a06evboxsync/**
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Context Info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct _ContextInfo {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int id; /**< integer context ID */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync VisualInfo *visual;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLboolean everCurrent;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLboolean haveWindowPosARB;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync WindowInfo *currentWindow;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#if defined(WINDOWS)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync HGLRC hRC;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#elif defined(DARWIN)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# ifndef VBOX_WITH_COCOA_QT
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync AGLContext context;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# else
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync NativeGLCtxRef context;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#elif defined(GLX)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLXContext context;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync struct _ContextInfo *shared;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync char *extensionString;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync} ContextInfo;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/**
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Barrier info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRbarrier barrier;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLuint count;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync} Barrier;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/**
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync * Renderspu state info
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync SPUDispatchTable self;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int id;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync unsigned int window_id;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync unsigned int context_id;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /** config options */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /*@{*/
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync char *window_title;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int defaultX, defaultY;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync unsigned int defaultWidth, defaultHeight;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int default_visual;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int use_L2;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int fullscreen, ontop;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync char display_string[100];
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#if defined(GLX)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int try_direct;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int force_direct;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int sync;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int render_to_app_window;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int render_to_crut_window;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int crut_drawable;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int resizable;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int use_lut8, lut8[3][256];
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int borderless;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int nvSwapGroup;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int ignore_papi;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int ignore_window_moves;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int pbufferWidth, pbufferHeight;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int use_glxchoosevisual;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int draw_bbox;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /*@}*/
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRServer *server;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int gather_port;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int gather_userbuf_size;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRConnection **gather_conns;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLint drawCursor;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLint cursorX, cursorY;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int numVisuals;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync VisualInfo visuals[MAX_VISUALS];
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRHashTable *windowTable;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRHashTable *contextTable;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifndef CHROMIUM_THREADSAFE
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync ContextInfo *currentContext;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync crOpenGLInterface ws; /**< Window System interface */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRHashTable *barrierHash;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int is_swap_master, num_swap_clients;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int swap_mtu;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync char *swap_master_url;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync CRConnection **swap_conns;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef USE_OSMESA
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync /** Off screen rendering hooks. */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync int use_osmesa;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync OSMesaContext (*OSMesaCreateContext)( GLenum format, OSMesaContext sharelist );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLboolean (* OSMesaMakeCurrent)( OSMesaContext ctx,
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLubyte *buffer,
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLenum type,
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLsizei width,
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLsizei height );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync void (*OSMesaDestroyContext)( OSMesaContext ctx );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef RT_OS_WINDOWS
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync DWORD dwWinThreadId;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync HANDLE hWinThreadReadyEvent;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef RT_OS_DARWIN
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# ifndef VBOX_WITH_COCOA_QT
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync RgnHandle hRootVisibleRegion;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync RTSEMFASTMUTEX syncMutex;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync EventHandlerUPP hParentEventHandler;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync WindowGroupRef pParentGroup;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync WindowGroupRef pMasterGroup;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync GLint currentBufferName;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync uint64_t uiDockUpdateTS;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync bool fInit;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* RT_OS_DARWIN */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync} RenderSPU;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef RT_OS_WINDOWS
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
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*/
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define WM_VBOX_RENDERSPU_CREATE_WINDOW (WM_APP+1)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsynctypedef struct _VBOX_RENDERSPU_DESTROY_WINDOW {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync HWND hWnd; /* handle to window to destroy */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync} VBOX_RENDERSPU_DESTROY_WINDOW;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
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*/
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define WM_VBOX_RENDERSPU_DESTROY_WINDOW (WM_APP+2)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern RenderSPU render_spu;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync/* @todo remove this hack */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern uint64_t render_spu_parent_window_id;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef CHROMIUM_THREADSAFE
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern CRtsd _RenderTSD;
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define GET_CONTEXT(T) ContextInfo *T = (ContextInfo *) crGetTSD(&_RenderTSD)
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#else
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#define GET_CONTEXT(T) ContextInfo *T = render_spu.currentContext
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
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);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef RT_OS_DARWIN
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemSetRootVisibleRegion(GLint cRects, GLint *pRects);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# ifdef VBOX_WITH_COCOA_QT
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemFlush();
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemFinish();
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern void renderspu_SystemBindFramebufferEXT(GLenum target, GLuint framebuffer);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync# endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
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[] );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
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 );
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef __cplusplus
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncextern "C" {
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncDECLEXPORT(void) renderspuSetWindowId(uint64_t winId);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncDECLEXPORT(void) renderspuSetRootVisibleRegion(GLint cRects, GLint *pRects);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsyncDECLEXPORT(void) renderspuReparentWindow(GLint window);
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#ifdef __cplusplus
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync}
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync#endif /* CR_RENDERSPU_H */
a2e6357e0295f680b36aaf31bedd6409a5336165vboxsync