port: GrpDetector verbatim 40250 over a host IDirect3D8 (Direct3DCreate8); GrpDevice::Create verbatim
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
65c43a84cd
commit
fd4d9a39df
@@ -40,6 +40,11 @@ struct GraphicBaseAccess : CGraphicBase
|
||||
static DWORD PT() { return ms_ptVS; }
|
||||
static DWORD PNT() { return ms_pntVS; }
|
||||
static DWORD PNT2() { return ms_pnt2VS; }
|
||||
static LPDIRECT3D8 D3D() { return ms_lpd3d; }
|
||||
static D3D_SModeInfo* Mode() { return ms_kD3DDetector.GetD3DModeInfop(ms_iD3DAdapterInfo, ms_iD3DDevInfo, ms_iD3DModeInfo); }
|
||||
static const D3DPRESENT_PARAMETERS& PP() { return ms_d3dPresentParameter; }
|
||||
static DWORD Behavior() { return ms_dwD3DBehavior; }
|
||||
static void DetectorString(std::string* s) { ms_kD3DDetector.GetString(s); }
|
||||
};
|
||||
|
||||
static int g_failures = 0;
|
||||
@@ -309,6 +314,19 @@ int main(int argc, char** argv)
|
||||
CHECK(GraphicBaseAccess::PNT() == (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1));
|
||||
CHECK(GraphicBaseAccess::PNT2() == (D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX2));
|
||||
CHECK(GetMaxTextureWidth() == 4096 && GetMaxTextureHeight() == 4096);
|
||||
// D3D_CDisplayModeAutoDetector over the host adapter: its HAL device, the 800x600x32 mode Create asks
|
||||
// for, hardware vertex processing and the first depth format FindDepthStencilFormat tries (D16).
|
||||
CHECK(GraphicBaseAccess::D3D() == Direct3DCreate8(D3D_SDK_VERSION));
|
||||
{
|
||||
D3D_SModeInfo* mode = GraphicBaseAccess::Mode();
|
||||
CHECK(mode && mode->m_uScrWidth == 800 && mode->m_uScrHeight == 600 && mode->m_eD3DFmtPixel == D3DFMT_X8R8G8B8);
|
||||
CHECK(mode && mode->m_dwD3DBehavior == D3DCREATE_HARDWARE_VERTEXPROCESSING && mode->m_eD3DFmtDepthStencil == D3DFMT_D16);
|
||||
CHECK(GraphicBaseAccess::Behavior() == D3DCREATE_HARDWARE_VERTEXPROCESSING);
|
||||
CHECK(GraphicBaseAccess::PP().AutoDepthStencilFormat == D3DFMT_D16 && GraphicBaseAccess::PP().BackBufferFormat == D3DFMT_X8R8G8B8);
|
||||
std::string modes;
|
||||
GraphicBaseAccess::DetectorString(&modes);
|
||||
CHECK(modes.find("800x600x32 HWVP") != std::string::npos);
|
||||
}
|
||||
{
|
||||
CScreen screen;
|
||||
CHECK(!screen.IsLostDevice() && screen.RestoreDevice());
|
||||
|
||||
Reference in New Issue
Block a user