VBoxOGL.h revision 92014e4729fedcfc6951c590460b86a585973df7
/** @file
*
* VirtualBox Windows NT/2000/XP guest OpenGL ICD
*
* Copyright (C) 2006-2007 innotek GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*
*/
#ifndef __VBOXOGL_H__
#define __VBOXOGL_H__
#include <windows.h>
/* get rid of the inconsistent dll linkage warnings */
#define WINGDIAPI
#define WGL_WGLEXT_PROTOTYPES
typedef struct _icdTable
{
typedef struct
{
typedef struct
{
extern HINSTANCE hDllVBoxOGL;
#ifdef DEBUG
#define glLogError(a) \
{ \
/** @todo log error */ \
glSetError(a); \
}
#define DbgPrintf(a) VBoxDbgLog a
#ifdef VBOX_DEBUG_LVL2
#define DbgPrintf2(a) VBoxDbgLog a
#else
#define DbgPrintf2(a)
#endif
#else
#define glLogError(a) glSetError(a)
#define DbgPrintf(a)
#define DbgPrintf2(a)
#endif
/**
* Initialize the OpenGL guest-host communication channel
*
* @return success or failure (boolean)
* @param hDllInst Dll instance handle
*/
/**
* Destroy the OpenGL guest-host communication channel
*
* @return success or failure (boolean)
*/
BOOL VBoxOGLExit();
/**
* Initialize new thread
*
* @return success or failure (boolean)
*/
/**
* Clean up for terminating thread
*
* @return success or failure (boolean)
*/
/**
* Set the thread local OpenGL context
*
* @param pCtx thread local OpenGL context ptr
*/
/**
* Return the thread local OpenGL context
*
* @return thread local OpenGL context ptr or NULL if failure
*/
/**
* Queue a new OpenGL command
*
* @param enmOp OpenGL command op
* @param cParam Number of parameters
* @param cbParams Memory needed for parameters
*/
/**
* Add a parameter to the currently queued OpenGL command
*
* @param pParam Parameter ptr
* @param cbParam Parameter value size
*/
/**
* Add a parameter (variable size) to the currently queued OpenGL command
*
* @param pParam Parameter ptr
* @param cbParam Parameter value size
*/
/**
* Finish the queued command
*
* @param enmOp OpenGL command op
*/
/**
* Send an HGCM request
*
* @return VBox status code
* @param hDriver Driver handle
* @param pvData Data pointer
* @param cbData Data size
*/
#ifdef DEBUG
/**
* Log to the debug output device
*
* @param pszFormat Format string
* @param ... Variable parameters
*/
void VBoxDbgLog(char *pszFormat, ...);
#endif
/**
* Flush the OpenGL command queue and return the return val of the last command
*
* @returns return val of last command
*/
/**
* Flush the OpenGL command queue and return the return val of the last command
* The last command's final parameter is a pointer where its result is stored
*
* @returns return val of last command
* @param pLastParam Last parameter's address
* @param cbParam Last parameter's size
*/
/**
* Initialize OpenGL extensions
*
* @returns VBox status code
*/
int vboxInitOpenGLExtensions();
/**
* Check if an OpenGL extension is available on the host
*
* @returns available or not
* @param pszExtFunctionName
*/
bool VBoxIsExtensionAvailable(const char *pszExtFunctionName);
/**
* Query the specified cached parameter
*
* @returns requested cached value
* @param type Parameter type (Note: minimal checks only!)
*/
/**
* Query the specified cached texture level parameter
*
* @returns requested cached value
* @param type Parameter type (Note: minimal checks only!)
*/
/**
* Query the number of bytes required for a pixel in the specified format
*
* @returns requested pixel size
* @param type Parameter type
*/
/**
* Query the size of the specified data type
*
* @returns type size or 0 if unknown type
* @param type data type
*/
#endif /* __VBOXOGL_H__ */