[UI/D3D12] Small refactoring, allow BeginSwap to return false if no surface
This commit is contained in:
@@ -200,11 +200,15 @@ void Window::OnPaint(UIEvent* e) {
|
||||
io.DisplaySize = ImVec2(static_cast<float>(scaled_width()),
|
||||
static_cast<float>(scaled_height()));
|
||||
|
||||
context_->BeginSwap();
|
||||
bool can_swap = context_->BeginSwap();
|
||||
if (context_->WasLost()) {
|
||||
on_context_lost(e);
|
||||
return;
|
||||
}
|
||||
if (!can_swap) {
|
||||
// Surface not available.
|
||||
return;
|
||||
}
|
||||
|
||||
ImGui::NewFrame();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user