feat(gx): handle scene lifecycle in d3d backend

This commit is contained in:
fallenoak 2023-03-11 08:59:17 -06:00
parent 9a15edb6e4
commit 69282c0c94
2 changed files with 46 additions and 0 deletions

View file

@ -750,6 +750,27 @@ void CGxDeviceD3d::IRsSendToHw(EGxRenderState which) {
}
}
void CGxDeviceD3d::ISceneBegin() {
if (this->m_context) {
// TODO
if (SUCCEEDED(this->m_d3dDevice->BeginScene())) {
this->m_inScene = 1;
}
return;
}
// TODO
}
void CGxDeviceD3d::ISceneEnd() {
if (this->m_inScene) {
this->m_d3dDevice->EndScene();
this->m_inScene = 0;
}
}
void CGxDeviceD3d::ISetCaps(const CGxFormat& format) {
// Texture stages
@ -1243,6 +1264,27 @@ void CGxDeviceD3d::PoolSizeSet(CGxPool* pool, uint32_t size) {
// TODO
}
void CGxDeviceD3d::ScenePresent() {
if (this->m_context) {
CGxDevice::ScenePresent();
this->ISceneEnd();
// TODO
// TODO fixLag
// TODO
if (FAILED(this->m_d3dDevice->Present(nullptr, nullptr, nullptr, nullptr))) {
this->m_context = 0;
}
// TODO stereo handling
}
this->ISceneBegin();
}
void CGxDeviceD3d::ShaderCreate(CGxShader* shaders[], EGxShTarget target, const char* a4, const char* a5, int32_t permutations) {
CGxDevice::ShaderCreate(shaders, target, a4, a5, permutations);