Documente Academic
Documente Profesional
Documente Cultură
/** @file
* VBox OpenGL windows ICD driver functions
*/
/*
* Copyright (C) 2006-2016 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* you can redistribute it and/or modify it under the terms of the GNU
* General Public License (GPL) 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.
*/
#include
#include
#include
#include
#include
"cr_error.h"
"icd_drv.h"
"cr_gl.h"
"stub.h"
"cr_mem.h"
if ( !pfd ) {
return 2;
}
if ( nBytes != sizeof(*pfd) ) {
crWarning( "DrvDescribePixelFormat: nBytes=%u?", nBytes );
return 2;
}
if (iPixelFormat==1)
{
crMemZero(pfd, sizeof(*pfd));
pfd->nSize
pfd->nVersion
pfd->dwFlags
pfd->dwFlags
happy */
pfd->iPixelType
pfd->cColorBits
pfd->cRedBits
pfd->cRedShift
pfd->cGreenBits
pfd->cGreenShift
pfd->cBlueBits
pfd->cBlueShift
pfd->cAlphaBits
pfd->cAlphaShift
pfd->cAccumBits
pfd->cAccumRedBits
pfd->cAccumGreenBits
pfd->cAccumBlueBits
pfd->cAccumAlphaBits
pfd->cDepthBits
pfd->cStencilBits
pfd->cAuxBuffers
pfd->iLayerType
pfd->bReserved
pfd->dwLayerMask
pfd->dwVisibleMask
pfd->dwDamageMask
= sizeof(*pfd);
= 1;
= (PFD_DRAW_TO_WINDOW |
PFD_SUPPORT_OPENGL |
PFD_DOUBLEBUFFER);
|= 0x8000; /* <- Needed for VSG Open Inventor to be
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
PFD_TYPE_RGBA;
32;
8;
24;
8;
16;
8;
8;
8;
0;
0;
0;
0;
0;
0;
32;
8;
0;
PFD_MAIN_PLANE;
0;
0;
0;
0;
}
else
{
crMemZero(pfd, sizeof(*pfd));
pfd->nVersion
= 1;
pfd->dwFlags
= (PFD_DRAW_TO_WINDOW|
PFD_SUPPORT_OPENGL);
pfd->iPixelType
pfd->cColorBits
pfd->cRedBits
pfd->cRedShift
pfd->cGreenBits
pfd->cGreenShift
pfd->cBlueBits
=
=
=
=
=
=
=
PFD_TYPE_RGBA;
32;
8;
16;
8;
8;
8;
pfd->cBlueShift
pfd->cAlphaBits
pfd->cAlphaShift
pfd->cAccumBits
pfd->cAccumRedBits
pfd->cAccumGreenBits
pfd->cAccumBlueBits
pfd->cAccumAlphaBits
pfd->cDepthBits
pfd->cStencilBits
pfd->cAuxBuffers
pfd->iLayerType
pfd->bReserved
pfd->dwLayerMask
pfd->dwVisibleMask
pfd->dwDamageMask
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
0;
0;
0;
64;
16;
16;
16;
0;
16;
8;
0;
PFD_MAIN_PLANE;
0;
0;
0;
0;
}
/* the max PFD index */
return 2;
}
BOOL APIENTRY DrvDeleteContext(HGLRC hglrc)
{
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
ContextInfo *pContext;
PVBOXUHGSMI pHgsmi = NULL;
#endif
CR_DDI_PROLOGUE();
crDebug( "DrvDeleteContext(0x%x) called", hglrc );
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
crHashtableLock(stub.contextTable);
pContext = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned lo
ng) hglrc);
if (pContext)
pHgsmi = pContext->pHgsmi;
crHashtableUnlock(stub.contextTable);
#endif
stubDestroyContext( (unsigned long) hglrc );
#if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)
if (pHgsmi)
VBoxCrHgsmiDestroy(pHgsmi);
#endif
return true;
}
BOOL APIENTRY DrvCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
{
CR_DDI_PROLOGUE();
crWarning( "DrvCopyContext: unsupported" );
return 0;
}