glwindrv.cpp revision 648f4eb3997820a317f8aa900598a4b7fe425c23
/** @file
* VBox OpenGL
*/
/*
* 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.
*/
#include "vboxgl.h"
#define LOG_GROUP LOG_GROUP_SHARED_OPENGL
#include "gldrv.h"
#ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
{
switch (message)
{
case WM_CREATE:
return 0;
case WM_CLOSE:
PostQuitMessage( 0 );
return 0;
case WM_DESTROY:
return 0;
default:
}
}
{
0, 0, 0, 0,
while(true)
{
{
break;
}
}
return VINF_SUCCESS;
}
#endif
/**
* Global init of VBox OpenGL for windows
*
* @returns VBox error code
*/
int vboxglGlobalInit()
{
#ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
RegisterClass(&wc);
#endif
int iFormat;
/** @todo should NOT use the desktop window -> crashes the Intel OpenGL driver */
return VINF_SUCCESS;
}
/**
* Enable OpenGL
*
* @returns VBox error code
* @param pClient Client context
*/
{
int iFormat;
/** @todo should NOT use the desktop window -> crashes the Intel OpenGL driver */
return VINF_SUCCESS;
}
/**
* Disable OpenGL
*
* @returns VBox error code
* @param pClient Client context
*/
{
return VINF_SUCCESS;
}
/**
* Client connect init
*
* @returns VBox error code
* @param pClient Client context
*/
{
Log(("vboxglConnect\n"));
return VINF_SUCCESS;
}
/**
* Client disconnect cleanup
*
* @returns VBox error code
* @param pClient Client context
*/
{
Log(("vboxglDisconnect\n"));
#ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
{
}
#endif
return VINF_SUCCESS;
}
/* Driver functions */
{
pClient->fHasLastError = true;
}
{
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
/* clear current selection */
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
OGL_PARAM(int, iLayerPlane);
pClient->fHasLastError = true;
}
{
pClient->fHasLastError = true;
}
{
OGL_PARAM(int, iLayerPlane);
pClient->lastretval = wglRealizeLayerPalette(VBOX_OGL_GUEST_TO_HOST_HDC(hdc), iLayerPlane, bRealize);
pClient->fHasLastError = true;
}
{
pClient->fHasLastError = true;
}
{
int rc;
OGL_PARAM(int, iPixelFormat);
#ifdef VBOX_OGL_DEBUG_WINDOW_OUTPUT
{
RTThreadSleep(100);
}
SetWindowPos(pClient->hwnd, NULL, 0, 0, cx, cy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER);
if (rc)
{
}
else
{
pClient->lastretval = 0;
}
#else
AssertFailed();
#endif
pClient->fHasLastError = true;
}
{
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
OGL_PARAM(int, iPixelFormat);
OGL_PARAM(int, iLayerPlane);
pClient->lastretval = wglDescribeLayerPlane(VBOX_OGL_GUEST_TO_HOST_HDC(hdc), iPixelFormat, iLayerPlane, nBytes, plpd);
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
OGL_PARAM(int, iLayerPlane);
pClient->lastretval = wglSetLayerPaletteEntries(VBOX_OGL_GUEST_TO_HOST_HDC(hdc), iLayerPlane, iStart, cEntries, pcr);
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
OGL_PARAM(int, iLayerPlane);
pClient->lastretval = wglGetLayerPaletteEntries(VBOX_OGL_GUEST_TO_HOST_HDC(hdc), iLayerPlane, iStart, cEntries, pcr);
if (!pClient->lastretval)
pClient->fHasLastError = true;
}
{
OGL_PARAM(int, iPixelFormat);
if (!hdc)
if (!pClient->lastretval)
pClient->fHasLastError = true;
if (!VBOX_OGL_GUEST_TO_HOST_HDC(hdc))
}
{
return pfnProc;
}