mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-01-20 14:11:16 +00:00
Implement DirectDrawImpl::EnumDevices() (#92)
This commit is contained in:
parent
96c962f857
commit
ab83cd51c1
@ -146,21 +146,36 @@ HRESULT DirectDrawImpl::EnumDevices(LPD3DENUMDEVICESCALLBACK cb, void* ctx)
|
|||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
|
|
||||||
GUID deviceGuid = {0xA1B2C3D4, 0x1122, 0x3344, {0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, 0x00, 0x11}};
|
int numDrivers = SDL_GetNumRenderDrivers();
|
||||||
|
if (numDrivers <= 0) {
|
||||||
|
return DDERR_GENERIC;
|
||||||
|
}
|
||||||
|
|
||||||
char* deviceName = (char*) "MiniWin 3D Device";
|
const char* deviceDesc = "SDL3-backed renderer";
|
||||||
char* deviceDesc = (char*) "Stubbed 3D device";
|
char* deviceDescDup = SDL_strdup(deviceDesc);
|
||||||
|
|
||||||
D3DDEVICEDESC halDesc = {};
|
for (int i = 0; i < numDrivers; ++i) {
|
||||||
halDesc.dcmColorModel = D3DCOLORMODEL::RGB;
|
const char* deviceName = SDL_GetRenderDriver(i);
|
||||||
halDesc.dwDeviceZBufferBitDepth = DDBD_16;
|
if (!deviceName) {
|
||||||
halDesc.dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
return DDERR_GENERIC;
|
||||||
D3DDEVICEDESC helDesc = {};
|
}
|
||||||
halDesc.dcmColorModel = D3DCOLORMODEL::RGB;
|
|
||||||
halDesc.dwDeviceZBufferBitDepth = DDBD_16;
|
|
||||||
halDesc.dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
|
||||||
|
|
||||||
cb(&deviceGuid, deviceName, deviceDesc, &halDesc, &helDesc, ctx);
|
GUID deviceGuid = {0x682656F3, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, (uint8_t) i}};
|
||||||
|
|
||||||
|
D3DDEVICEDESC halDesc = {};
|
||||||
|
halDesc.dcmColorModel = D3DCOLORMODEL::RGB;
|
||||||
|
halDesc.dwFlags = D3DDD_DEVICEZBUFFERBITDEPTH;
|
||||||
|
halDesc.dwDeviceZBufferBitDepth = DDBD_8 | DDBD_16 | DDBD_24 | DDBD_32;
|
||||||
|
halDesc.dwDeviceRenderBitDepth = DDBD_8 | DDBD_16;
|
||||||
|
halDesc.dpcTriCaps.dwTextureCaps = D3DPTEXTURECAPS_PERSPECTIVE;
|
||||||
|
halDesc.dpcTriCaps.dwShadeCaps = D3DPSHADECAPS_ALPHAFLATBLEND;
|
||||||
|
halDesc.dpcTriCaps.dwTextureFilterCaps = D3DPTFILTERCAPS_LINEAR;
|
||||||
|
|
||||||
|
char* deviceNameDup = SDL_strdup(deviceName);
|
||||||
|
cb(&deviceGuid, deviceNameDup, deviceDescDup, &halDesc, &halDesc, ctx);
|
||||||
|
SDL_free(deviceNameDup);
|
||||||
|
}
|
||||||
|
SDL_free(deviceDescDup);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user