summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/RenderBase.h
diff options
context:
space:
mode:
authorStenzek <stenzek@gmail.com>2018-10-10 00:57:52 +1100
committerStenzek <stenzek@gmail.com>2019-01-25 11:10:49 +1000
commitd1868d9475db2ec99314a2f7f192a63fc40bf962 (patch)
treec2f4d2ffc46429fbb50c4723c65bed5da90fe0ac /Source/Core/VideoCommon/RenderBase.h
parent396b7c2978498712f6e6eea7f353408f3c33c147 (diff)
RenderBase: Implement imgui rendering
Diffstat (limited to 'Source/Core/VideoCommon/RenderBase.h')
-rw-r--r--Source/Core/VideoCommon/RenderBase.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/RenderBase.h b/Source/Core/VideoCommon/RenderBase.h
index 4e9c60efae..b232d2c61f 100644
--- a/Source/Core/VideoCommon/RenderBase.h
+++ b/Source/Core/VideoCommon/RenderBase.h
@@ -40,6 +40,7 @@ class AbstractPipeline;
class AbstractShader;
class AbstractTexture;
class AbstractStagingTexture;
+class NativeVertexFormat;
class PostProcessingShaderImplementation;
struct TextureConfig;
struct ComputePipelineConfig;
@@ -166,6 +167,9 @@ public:
void SaveScreenshot(const std::string& filename, bool wait_for_completion);
void DrawDebugText();
+ // ImGui initialization depends on being able to create textures and pipelines, so do it last.
+ bool InitializeImGui();
+
virtual void RenderText(const std::string& text, int left, int top, u32 color) = 0;
virtual void ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable,
@@ -208,6 +212,15 @@ protected:
void CheckFifoRecording();
void RecordVideoMemory();
+ // Renders ImGui windows to the currently-bound framebuffer.
+ void DrawImGui();
+
+ // Destroys all ImGui GPU resources, must do before shutdown.
+ void ShutdownImGui();
+
+ // Sets up ImGui state for the next frame.
+ void BeginImGuiFrame();
+
// TODO: Remove the width/height parameters once we make the EFB an abstract framebuffer.
const AbstractFramebuffer* m_current_framebuffer = nullptr;
u32 m_current_framebuffer_width = 1;
@@ -241,6 +254,12 @@ protected:
u32 m_last_host_config_bits = 0;
u32 m_last_efb_multisamples = 1;
+ // ImGui resources.
+ std::unique_ptr<NativeVertexFormat> m_imgui_vertex_format;
+ std::vector<std::unique_ptr<AbstractTexture>> m_imgui_textures;
+ std::unique_ptr<AbstractPipeline> m_imgui_pipeline;
+ u64 m_imgui_last_frame_time;
+
private:
void RunFrameDumps();
std::tuple<int, int> CalculateOutputDimensions(int width, int height);