[UI/D3D12] Small refactoring, allow BeginSwap to return false if no surface

This commit is contained in:
Triang3l
2020-09-14 23:27:19 +03:00
parent acb1fc059f
commit dfbe36a8aa
9 changed files with 149 additions and 132 deletions

View File

@@ -51,7 +51,8 @@ class GraphicsContext {
// This context must be made current in order for this call to work properly.
virtual bool WasLost() = 0;
virtual void BeginSwap() = 0;
// Returns true if able to draw now (the target surface is available).
virtual bool BeginSwap() = 0;
virtual void EndSwap() = 0;
virtual std::unique_ptr<RawImage> Capture() = 0;
@@ -59,6 +60,8 @@ class GraphicsContext {
protected:
explicit GraphicsContext(GraphicsProvider* provider, Window* target_window);
static void GetClearColor(float* rgba);
GraphicsProvider* provider_ = nullptr;
Window* target_window_ = nullptr;
};