gllindrv.cpp revision 92014e4729fedcfc6951c590460b86a585973df7
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/** @file
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * VBox OpenGL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Simple buffered OpenGL functions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright (C) 2006-2007 innotek GmbH
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * This file is part of VirtualBox Open Source Edition (OSE), as
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * available from http://www.virtualbox.org. This file is free software;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * you can redistribute it and/or modify it under the terms of the GNU
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * General Public License as published by the Free Software Foundation,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * distribution. VirtualBox OSE is distributed in the hope that it will
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * be useful, but WITHOUT ANY WARRANTY of any kind.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If you received this file as part of a commercial VirtualBox
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * distribution, then only the terms of your commercial VirtualBox
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * license agreement apply instead of the previous paragraph.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include "vboxgl.h"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define LOG_GROUP LOG_GROUP_SHARED_OPENGL
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#include <VBox/log.h>
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Global init of VBox OpenGL for windows
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @returns VBox error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint vboxglGlobalInit()
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte vboxInitOpenGLExtensions();
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return VINF_SUCCESS;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Client connect init
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @returns VBox error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param pClient Client context
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint vboxglConnect(PVBOXOGLCTX pClient)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return VINF_SUCCESS;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/**
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Client disconnect cleanup
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte *
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @returns VBox error code
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * @param pClient Client context
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forteint vboxglDisconnect(PVBOXOGLCTX pClient)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte return VINF_SUCCESS;
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* Driver functions */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid vboxglDrvCreateContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_CMD(DrvCreateContext, 4);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HDC, hdc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(uint32_t, cx);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(uint32_t, cy);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(BYTE, cColorBits);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(BYTE, iPixelType);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(BYTE, cDepthBits);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pClient->lastretval = 0; /** @todo */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid vboxglDrvDeleteContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_CMD(DrvDeleteContext, 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HGLRC, hglrc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte /** @todo */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pClient->lastretval = 0; /** @todo */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid vboxglDrvSetContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_CMD(DrvSetContext, 2);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HDC, hdc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HGLRC, hglrc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pClient->lastretval = 0; /** @todo */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid vboxglDrvCopyContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_CMD(DrvDeleteContext, 3);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HGLRC, hglrcSrc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HGLRC, hglrcDst);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(UINT, mask);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pClient->lastretval = 0; /** @todo */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid vboxglDrvReleaseContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_CMD(DrvReleaseContext, 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HGLRC, hglrc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pClient->lastretval = 0; /** @todo */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte}
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortevoid vboxglDrvCreateLayerContext(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte{
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_CMD(DrvCreateLayerContext, 5);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(HDC, hdc);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(int, iLayerPlane);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(uint32_t, cx);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(uint32_t, cy);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(BYTE, cColorBits);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(BYTE, iPixelType);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte OGL_PARAM(BYTE, cDepthBits);
AssertFailed();
/** @todo create memory dc with the parameters above */
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvShareLists(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
OGL_CMD(DrvShareLists, 3);
OGL_PARAM(HGLRC, hglrc1);
OGL_PARAM(HGLRC, hglrc2);
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvRealizeLayerPalette(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
OGL_CMD(DrvRealizeLayerPalette, 3);
OGL_PARAM(HDC, hdc);
OGL_PARAM(int, iLayerPlane);
OGL_PARAM(BOOL, bRealize);
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvSwapLayerBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
OGL_CMD(DrvSwapLayerBuffers, 2);
OGL_PARAM(HDC, hdc);
OGL_PARAM(UINT, fuPlanes);
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvSetPixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
OGL_CMD(DrvSetPixelFormat, 2);
OGL_PARAM(HDC, hdc);
OGL_PARAM(int, iPixelFormat);
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvSwapBuffers(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
OGL_CMD(DrvSwapBuffers, 1);
OGL_PARAM(HDC, hdc);
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvDescribeLayerPlane(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
PLAYERPLANEDESCRIPTOR plpd;
OGL_CMD(DrvDescribeLayerPlane, 4);
OGL_PARAM(HDC, hdc);
OGL_PARAM(int, iPixelFormat);
OGL_PARAM(int, iLayerPlane);
OGL_PARAM(UINT, nBytes);
Assert(pClient->cbLastParam == nBytes);
plpd = (PLAYERPLANEDESCRIPTOR)pClient->pLastParam;
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvSetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
OGL_CMD(DrvSetLayerPaletteEntries, 5);
OGL_PARAM(HDC, hdc);
OGL_PARAM(int, iLayerPlane);
OGL_PARAM(int, iStart);
OGL_PARAM(int, cEntries);
OGL_MEMPARAM(COLORREF, pcr);
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvGetLayerPaletteEntries(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
COLORREF *pcr;
OGL_CMD(DrvGetLayerPaletteEntries, 4);
OGL_PARAM(HDC, hdc);
OGL_PARAM(int, iLayerPlane);
OGL_PARAM(int, iStart);
OGL_PARAM(int, cEntries);
Assert(pClient->cbLastParam == sizeof(COLORREF)*cEntries);
pcr = (COLORREF *)pClient->pLastParam;
pClient->lastretval = 0; /** @todo */
}
void vboxglDrvDescribePixelFormat(VBOXOGLCTX *pClient, uint8_t *pCmdBuffer)
{
LPPIXELFORMATDESCRIPTOR ppfd;
OGL_CMD(DrvDescribePixelFormat, 3);
OGL_PARAM(HDC, hdc);
OGL_PARAM(int, iPixelFormat);
OGL_PARAM(UINT, nBytes);
Assert(pClient->cbLastParam == nBytes);
ppfd = (LPPIXELFORMATDESCRIPTOR)pClient->pLastParam;
pClient->lastretval = 0; /** @todo */
}
bool vboxDrvIsExtensionAvailable(char *pszExtFunctionName)
{
return false;
}