wined3d: CheckDeviceMultiSampleType

Vitaly Budovski vbudovsk at cs.rmit.edu.au
Sun Feb 5 01:34:05 CST 2006


Can I have some feedback on the attached patch? I'm not entirely sure 
it's correct.


Thanks,

Vitaly
-------------- next part --------------
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 7aa8d5d..8394362 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1245,6 +1245,13 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceM
                                                        BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD*   pQualityLevels) {
 
     IWineD3DImpl *This = (IWineD3DImpl *)iface;
+    HDC deviceContext;
+    Display * pDisplay;
+    GLXFBConfig * pConfig;
+    int attributeList[5] = {GLX_SAMPLE_BUFFERS_ARB, 1, GLX_SAMPLES_ARB, MultiSampleType, 0};
+    int configCount;
+    int attributeValue;
+
     TRACE_(d3d_caps)("(%p)-> (STUB) (Adptr:%d, DevType:(%x,%s), SurfFmt:(%x,%s), Win?%d, MultiSamp:%x, pQual:%p)\n",
           This,
           Adapter,
@@ -1267,7 +1274,32 @@ HRESULT WINAPI IWineD3DImpl_CheckDeviceM
         *pQualityLevels = 1; /* Guess at a value! */
     }
 
-    if (D3DMULTISAMPLE_NONE == MultiSampleType) return D3D_OK;
+    if(D3DMULTISAMPLE_NONE == MultiSampleType) return D3D_OK;
+
+    /* Get the display */
+    deviceContext = GetDC(0);
+    pDisplay = get_display(deviceContext);
+
+    ENTER_GL();
+
+    pConfig = glXChooseFBConfig(pDisplay, 0, attributeList, &configCount);
+    if(pConfig) {
+        if(!glXGetFBConfigAttrib(pDisplay, *pConfig, GLX_SAMPLES, &attributeValue)) {
+            XFree(pConfig);
+
+            LEAVE_GL();
+            ReleaseDC(0, deviceContext);
+            
+            return D3D_OK;
+        }
+    } else {
+        FIXME("Error retrieving FBConfig\n");
+    }
+    XFree(pConfig);
+
+    LEAVE_GL();
+    ReleaseDC(0, deviceContext);
+    
     return D3DERR_NOTAVAILABLE;
 }
 


More information about the wine-devel mailing list