diff options
| author | spycrab <spycrab@users.noreply.github.com> | 2019-01-25 15:08:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-25 15:08:40 +0100 |
| commit | 6962d5bc5217562b0200a47968e013e9c820feeb (patch) | |
| tree | 2b6a1de08745ae7c5afe1c492446547c3edb8c30 /Source/Core/VideoBackends/Software | |
| parent | e060b133e36f5bb0bda909186084d0d933e9c538 (diff) | |
| parent | 774480ba234c788d2973cf6a3ccd1cd4c3fcc673 (diff) | |
Merge pull request #7478 from stenzek/imgui
Replace raster font with dear imgui
Diffstat (limited to 'Source/Core/VideoBackends/Software')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWOGLWindow.cpp | 15 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWOGLWindow.h | 13 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWRenderer.cpp | 16 | ||||
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWRenderer.h | 3 |
4 files changed, 6 insertions, 41 deletions
diff --git a/Source/Core/VideoBackends/Software/SWOGLWindow.cpp b/Source/Core/VideoBackends/Software/SWOGLWindow.cpp index 81216ff7ef..91c8cf0806 100644 --- a/Source/Core/VideoBackends/Software/SWOGLWindow.cpp +++ b/Source/Core/VideoBackends/Software/SWOGLWindow.cpp @@ -84,14 +84,9 @@ bool SWOGLWindow::Initialize(const WindowSystemInfo& wsi) return true; } -void SWOGLWindow::PrintText(const std::string& text, int x, int y, u32 color) +void SWOGLWindow::ShowImage(const AbstractTexture* image, const EFBRectangle& xfb_region) { - m_text.push_back({text, x, y, color}); -} - -void SWOGLWindow::ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region) -{ - SW::SWTexture* sw_image = static_cast<SW::SWTexture*>(image); + const SW::SWTexture* sw_image = static_cast<const SW::SWTexture*>(image); m_gl_context->Update(); // just updates the render window position and the backbuffer size GLsizei glWidth = (GLsizei)m_gl_context->GetBackBufferWidth(); @@ -116,11 +111,5 @@ void SWOGLWindow::ShowImage(AbstractTexture* image, const EFBRectangle& xfb_regi glBindVertexArray(m_image_vao); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); - // TODO: implement OSD - // for (TextData& text : m_text) - // { - // } - m_text.clear(); - m_gl_context->Swap(); } diff --git a/Source/Core/VideoBackends/Software/SWOGLWindow.h b/Source/Core/VideoBackends/Software/SWOGLWindow.h index 38ae316d07..f1eadc4dd5 100644 --- a/Source/Core/VideoBackends/Software/SWOGLWindow.h +++ b/Source/Core/VideoBackends/Software/SWOGLWindow.h @@ -24,11 +24,8 @@ public: GLContext* GetContext() const { return m_gl_context.get(); } bool IsHeadless() const; - // Will be printed on the *next* image - void PrintText(const std::string& text, int x, int y, u32 color); - // Image to show, will be swapped immediately - void ShowImage(AbstractTexture* image, const EFBRectangle& xfb_region); + void ShowImage(const AbstractTexture* image, const EFBRectangle& xfb_region); static std::unique_ptr<SWOGLWindow> Create(const WindowSystemInfo& wsi); @@ -37,14 +34,6 @@ private: bool Initialize(const WindowSystemInfo& wsi); - struct TextData - { - std::string text; - int x, y; - u32 color; - }; - std::vector<TextData> m_text; - u32 m_image_program = 0; u32 m_image_texture = 0; u32 m_image_vao = 0; diff --git a/Source/Core/VideoBackends/Software/SWRenderer.cpp b/Source/Core/VideoBackends/Software/SWRenderer.cpp index 0b64022725..6369b35b20 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.cpp +++ b/Source/Core/VideoBackends/Software/SWRenderer.cpp @@ -25,7 +25,7 @@ #include "VideoCommon/VideoConfig.h" SWRenderer::SWRenderer(std::unique_ptr<SWOGLWindow> window) - : ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT), + : ::Renderer(static_cast<int>(MAX_XFB_WIDTH), static_cast<int>(MAX_XFB_HEIGHT), 1.0f, AbstractTextureFormat::RGBA8), m_window(std::move(window)) { @@ -55,11 +55,6 @@ SWRenderer::CreateFramebuffer(const AbstractTexture* color_attachment, static_cast<const SW::SWTexture*>(depth_attachment)); } -void SWRenderer::RenderText(const std::string& pstr, int left, int top, u32 color) -{ - m_window->PrintText(pstr, left, top, color); -} - class SWShader final : public AbstractShader { public: @@ -95,17 +90,10 @@ std::unique_ptr<AbstractPipeline> SWRenderer::CreatePipeline(const AbstractPipel } // Called on the GPU thread -void SWRenderer::SwapImpl(AbstractTexture* texture, const EFBRectangle& xfb_region, u64 ticks) +void SWRenderer::RenderXFBToScreen(const AbstractTexture* texture, const EFBRectangle& xfb_region) { - OSD::DoCallbacks(OSD::CallbackType::OnFrame); - if (!IsHeadless()) - { - DrawDebugText(); m_window->ShowImage(texture, xfb_region); - } - - UpdateActiveConfig(); } u32 SWRenderer::AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData) diff --git a/Source/Core/VideoBackends/Software/SWRenderer.h b/Source/Core/VideoBackends/Software/SWRenderer.h index 936139516f..88c5ece360 100644 --- a/Source/Core/VideoBackends/Software/SWRenderer.h +++ b/Source/Core/VideoBackends/Software/SWRenderer.h @@ -32,7 +32,6 @@ public: size_t length) override; std::unique_ptr<AbstractPipeline> CreatePipeline(const AbstractPipelineConfig& config) override; - void RenderText(const std::string& pstr, int left, int top, u32 color) override; u32 AccessEFB(EFBAccessType type, u32 x, u32 y, u32 poke_data) override; void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points) override {} u16 BBoxRead(int index) override; @@ -40,7 +39,7 @@ public: TargetRectangle ConvertEFBRectangle(const EFBRectangle& rc) override; - void SwapImpl(AbstractTexture* texture, const EFBRectangle& rc, u64 ticks) override; + void RenderXFBToScreen(const AbstractTexture* texture, const EFBRectangle& rc) override; void ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaEnable, bool zEnable, u32 color, u32 z) override; |
