From 58cc33f93812d40dcec56cce4a00337314fb6c8f Mon Sep 17 00:00:00 2001 From: Webster Sheets Date: Tue, 5 Sep 2023 15:58:09 -0400 Subject: [PATCH] GuiApplication provides Graphics::Settings access --- src/core/GuiApplication.cpp | 2 ++ src/core/GuiApplication.h | 6 +++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/GuiApplication.cpp b/src/core/GuiApplication.cpp index e0cdb7fd9ba..190c710a738 100644 --- a/src/core/GuiApplication.cpp +++ b/src/core/GuiApplication.cpp @@ -162,6 +162,8 @@ Graphics::Renderer *GuiApplication::StartupRenderer(IniConfig *config, bool hidd m_renderer.reset(Graphics::Init(videoSettings)); m_renderTarget.reset(CreateRenderTarget(videoSettings)); + m_settings = videoSettings; + return m_renderer.get(); } diff --git a/src/core/GuiApplication.h b/src/core/GuiApplication.h index f78e19569be..12dc3542ff1 100644 --- a/src/core/GuiApplication.h +++ b/src/core/GuiApplication.h @@ -7,7 +7,7 @@ #include "RefCounted.h" #include "SDL_events.h" -#include "graphics/Renderer.h" +#include "graphics/Graphics.h" class IniConfig; @@ -20,6 +20,7 @@ namespace PiGui { } namespace Graphics { + class Renderer; class RenderTarget; } @@ -34,6 +35,8 @@ class GuiApplication : public Application { Graphics::RenderTarget *GetRenderTarget() { return m_renderTarget.get(); } + const Graphics::Settings &GetGraphicsSettings() { return m_settings; } + protected: // Call this from your OnStartup() method @@ -85,4 +88,5 @@ class GuiApplication : public Application { std::unique_ptr m_renderer; std::unique_ptr m_renderTarget; + Graphics::Settings m_settings; };