Get the capabilities of the Direct3D device
| 171 | |
| 172 | // Get the capabilities of the Direct3D device |
| 173 | void d3d_GetCaps() { |
| 174 | d3d_TextureMemories = false; |
| 175 | d3d_CanFog = false; |
| 176 | d3d_MultiTexture = false; |
| 177 | d3d_WBuffer = false; |
| 178 | d3d_ZBias = false; |
| 179 | d3d_CanMip = false; |
| 180 | d3d_CanGamma = false; |
| 181 | d3d_CanZCompare = false; |
| 182 | d3d_WBias = 0; |
| 183 | d3d_CanBumpmap = false; |
| 184 | d3d_IsRiva128 = false; |
| 185 | d3d_SubpixelCorrect = true; |
| 186 | |
| 187 | // Check whether the device supports real multitexturing (if not, we're |
| 188 | // going to emulate it using multipass rendering) |
| 189 | D3DDEVICEDESC ddHwDesc, ddSwDesc; |
| 190 | ddHwDesc.dwSize = sizeof(D3DDEVICEDESC); |
| 191 | ddSwDesc.dwSize = sizeof(D3DDEVICEDESC); |
| 192 | lpD3DDevice->GetCaps(&ddHwDesc, &ddSwDesc); |
| 193 | |
| 194 | // See if we have separate texture memories |
| 195 | if (ddHwDesc.dwDevCaps & D3DDEVCAPS_SEPARATETEXTUREMEMORIES) { |
| 196 | d3d_TextureMemories = true; |
| 197 | mprintf(0, "Device has texture memories!\n"); |
| 198 | } |
| 199 | |
| 200 | // Check to see if this device supports bumpmapping |
| 201 | if (ddHwDesc.dwTextureOpCaps & D3DTEXOPCAPS_BUMPENVMAP) { |
| 202 | d3d_CanBumpmap = true; |
| 203 | mprintf(0, "Device support bumpmapping!\n"); |
| 204 | } else { |
| 205 | mprintf(0, "Device DOES NOT support bumpmapping!\n"); |
| 206 | } |
| 207 | |
| 208 | if (!FindArg("-bumped")) { |
| 209 | d3d_CanBumpmap = false; |
| 210 | mprintf(0, "Turning off bumpmapping because switch not found.\n"); |
| 211 | } |
| 212 | |
| 213 | // Check if the device supports single pass multiple texture. |
| 214 | if (ddHwDesc.wMaxSimultaneousTextures > 1) { |
| 215 | if (ddHwDesc.dwTextureOpCaps & D3DTEXOPCAPS_MODULATE) { |
| 216 | d3d_MultiTexture = true; |
| 217 | UseMultitexture = true; |
| 218 | } else { |
| 219 | UseMultitexture = false; |
| 220 | d3d_TextureMemories = false; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | if (FindArg("-NoMultitexture")) { |
| 225 | d3d_MultiTexture = false; |
| 226 | UseMultitexture = false; |
| 227 | d3d_TextureMemories = false; |
| 228 | } |
| 229 | |
| 230 | if (d3d_MultiTexture) |