feat(RHI): 实现 RHISwapChain 抽象基类
This commit is contained in:
@@ -105,5 +105,19 @@ void* D3D12SwapChain::GetNativeHandle() const {
|
||||
return reinterpret_cast<void*>(m_swapChain.Get());
|
||||
}
|
||||
|
||||
RHITexture* D3D12SwapChain::GetCurrentBackBuffer() {
|
||||
return GetBackBuffer(GetCurrentBackBufferIndex());
|
||||
}
|
||||
|
||||
bool D3D12SwapChain::ShouldClose() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
void D3D12SwapChain::SetShouldClose(bool shouldClose) {
|
||||
}
|
||||
|
||||
void D3D12SwapChain::PollEvents() {
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
@@ -116,5 +116,34 @@ void OpenGLSwapChain::PollEvents() {
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
void OpenGLSwapChain::Present(uint32_t syncInterval, uint32_t flags) {
|
||||
if (m_window) {
|
||||
glfwSwapBuffers(m_window);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenGLSwapChain::Resize(uint32_t width, uint32_t height) {
|
||||
Resize(static_cast<int>(width), static_cast<int>(height));
|
||||
}
|
||||
|
||||
void OpenGLSwapChain::SetFullscreen(bool fullscreen) {
|
||||
}
|
||||
|
||||
bool OpenGLSwapChain::IsFullscreen() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
uint32_t OpenGLSwapChain::GetCurrentBackBufferIndex() const {
|
||||
return 0;
|
||||
}
|
||||
|
||||
RHITexture* OpenGLSwapChain::GetCurrentBackBuffer() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* OpenGLSwapChain::GetNativeHandle() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
} // namespace RHI
|
||||
} // namespace XCEngine
|
||||
|
||||
Reference in New Issue
Block a user