VirtualBox

Ignore:
Timestamp:
Jul 5, 2007 1:49:32 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
22679
Message:

OGL: updates

Location:
trunk/src/VBox/HostServices/SharedOpenGL
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/glwindrv.cpp

    r3463 r3467  
    419419bool vboxDrvIsExtensionAvailable(char *pszExtFunctionName)
    420420{
    421     Log(("vboxDrvIsExtensionAvailable %s -> %d\n", pszExtFunctionName, !!wglGetProcAddress(pszExtFunctionName)));
    422     return !!wglGetProcAddress(pszExtFunctionName);
    423 }
     421    PIXELFORMATDESCRIPTOR pfd;
     422    int iFormat;
     423    HDC hdc = GetDC(0);
     424
     425/** @todo rather expensive -> check all known extensions in one go */
     426    ZeroMemory(&pfd, sizeof(pfd));
     427    pfd.nSize       = sizeof(pfd);
     428    pfd.nVersion    = 1;
     429    pfd.dwFlags     = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
     430    pfd.iPixelType  = PFD_TYPE_RGBA;
     431    pfd.cColorBits  = 24;
     432    pfd.cDepthBits  = 16;
     433    pfd.iLayerType  = PFD_MAIN_PLANE;
     434    iFormat         = ChoosePixelFormat(hdc, &pfd);
     435    SetPixelFormat(hdc, iFormat, &pfd);
     436
     437    HGLRC hRC = wglCreateContext(hdc);
     438    wglMakeCurrent(hdc, hRC);
     439
     440    bool fAvailable = !!wglGetProcAddress(pszExtFunctionName);
     441
     442    Log(("vboxDrvIsExtensionAvailable %s -> %d\n", pszExtFunctionName, fAvailable));
     443
     444    wglMakeCurrent(NULL, NULL);
     445    wglDeleteContext(hRC);
     446    ReleaseDC(0, hdc);
     447
     448    return fAvailable;
     449}
  • trunk/src/VBox/HostServices/SharedOpenGL/service.cpp

    r3461 r3467  
    280280                /* sanity checks */
    281281                if (    cbExtFnName > 256
    282                     ||  pszExtFnName[cbExtFnName] != 0
     282                    ||  pszExtFnName[cbExtFnName-1] != 0
    283283                   )
    284284                {
  • trunk/src/VBox/HostServices/SharedOpenGL/vboxgl.cpp

    r3441 r3467  
    126126        AssertMsgReturn(pCmd->enmOp < VBOX_OGL_OP_Last, ("Invalid OpenGL cmd %x\n", pCmd->enmOp), VERR_INVALID_PARAMETER);
    127127
    128         Log2(("Flush cmd %s cParams=%d cbCmd=%x\n", pszVBoxOGLCmd[pCmd->enmOp], pCmd->cParams, pCmd->cbCmd));
     128if (   pCmd->enmOp != VBOX_OGL_OP_Vertex3f
     129    && pCmd->enmOp != VBOX_OGL_OP_Normal3f)
     130        Log(("Flush cmd %s cParams=%d cbCmd=%x\n", pszVBoxOGLCmd[pCmd->enmOp], pCmd->cParams, pCmd->cbCmd));
    129131
    130132        /* call wrapper */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette