VirtualBox

Ticket #2940: vbox_opengl_workarounds.2.diff

File vbox_opengl_workarounds.2.diff, 3.9 KB (added by Anton Baskanov, 16 years ago)
  • wine/dlls/wined3d/directx.c

    a b static BOOL IWineD3DImpl_FillGLCaps(Wine  
    13991399    /* Make sure there's an active HDC else the WGL extensions will fail */
    14001400    hdc = pwglGetCurrentDC();
    14011401    if (hdc) {
     1402        if(NULL == GL_EXTCALL(wglGetExtensionsStringARB)) {
     1403            WARN("wglGetExtensionsStringARB is unavailable\n");
     1404        }
     1405        else {
    14021406        WGL_Extensions = GL_EXTCALL(wglGetExtensionsStringARB(hdc));
    14031407        TRACE_(d3d_caps)("WGL_Extensions reported:\n");
    14041408
    static BOOL IWineD3DImpl_FillGLCaps(Wine  
    14351439            }
    14361440        }
    14371441    }
     1442    }
    14381443    LEAVE_GL();
    14391444
    14401445    return return_value;
    BOOL InitAdapters(void) {  
    42864291        TRACE("DeviceName: %s\n", debugstr_w(DisplayDevice.DeviceName));
    42874292        strcpyW(Adapters[0].DeviceName, DisplayDevice.DeviceName);
    42884293
     4294        if(NULL == GL_EXTCALL(wglGetPixelFormatAttribivARB)) {
     4295            WARN("wglGetPixelFormatAttribivARB is unavailable\n");
     4296            Adapters[0].nCfgs=DescribePixelFormat(hdc,0,0,NULL);
     4297
     4298            Adapters[0].cfgs = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Adapters[0].nCfgs *sizeof(WineD3D_PixelFormat));
     4299            cfgs = Adapters[0].cfgs;
     4300
     4301            for(iPixelFormat=1; iPixelFormat<=Adapters[0].nCfgs; iPixelFormat++) {
     4302                PIXELFORMATDESCRIPTOR pfd={0};
     4303                res = DescribePixelFormat(hdc,iPixelFormat,sizeof(pfd),&pfd);
     4304
     4305                if(!res)
     4306                    continue;
     4307
     4308                /* Cache the pixel format */
     4309                cfgs->iPixelFormat = iPixelFormat;
     4310                cfgs->redSize = pfd.cRedBits;
     4311                cfgs->greenSize = pfd.cGreenBits;
     4312                cfgs->blueSize = pfd.cBlueBits;
     4313                cfgs->alphaSize = pfd.cAlphaBits;
     4314                cfgs->depthSize = pfd.cDepthBits;
     4315                cfgs->stencilSize = pfd.cStencilBits;
     4316                cfgs->windowDrawable = (PFD_DRAW_TO_WINDOW == (pfd.dwFlags & PFD_DRAW_TO_WINDOW));
     4317                switch (pfd.iPixelType)
     4318                {
     4319                case PFD_TYPE_RGBA:
     4320                        cfgs->iPixelType = WGL_TYPE_RGBA_ARB;
     4321                        break;
     4322                case PFD_TYPE_COLORINDEX:
     4323                        cfgs->iPixelType = WGL_TYPE_COLORINDEX_ARB;
     4324                        break;
     4325                default:
     4326                        cfgs->iPixelType = 0;
     4327                }
     4328                cfgs->doubleBuffer = (PFD_DOUBLEBUFFER == (pfd.dwFlags & PFD_DOUBLEBUFFER));
     4329                cfgs->auxBuffers = pfd.cAuxBuffers;
     4330
     4331                cfgs->pbufferDrawable = FALSE;
     4332                cfgs->numSamples = 0;
     4333
     4334                TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d\n", cfgs->iPixelFormat, cfgs->iPixelType, cfgs->doubleBuffer, cfgs->redSize, cfgs->greenSize, cfgs->blueSize, cfgs->alphaSize, cfgs->depthSize, cfgs->stencilSize, cfgs->windowDrawable, cfgs->pbufferDrawable);
     4335                cfgs++;
     4336            }
     4337        }
     4338        else {
    42894339        attribute = WGL_NUMBER_PIXEL_FORMATS_ARB;
    42904340        GL_EXTCALL(wglGetPixelFormatAttribivARB(hdc, 0, 0, 1, &attribute, &Adapters[0].nCfgs));
    42914341
    BOOL InitAdapters(void) {  
    43464396            TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, depth=%d, stencil=%d, windowDrawable=%d, pbufferDrawable=%d\n", cfgs->iPixelFormat, cfgs->iPixelType, cfgs->doubleBuffer, cfgs->redSize, cfgs->greenSize, cfgs->blueSize, cfgs->alphaSize, cfgs->depthSize, cfgs->stencilSize, cfgs->windowDrawable, cfgs->pbufferDrawable);
    43474397            cfgs++;
    43484398        }
     4399        }
    43494400
    43504401        /* D16, D24X8 and D24S8 are common depth / depth+stencil formats. All drivers support them though this doesn't
    43514402         * mean that the format is offered in hardware. For instance Geforce8 cards don't have offer D16 in hardware

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