Skip to content

Commit

Permalink
GuiApplication provides Graphics::Settings access
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Sep 5, 2023
1 parent 00372bb commit 58cc33f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/core/GuiApplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 5 additions & 1 deletion src/core/GuiApplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "RefCounted.h"
#include "SDL_events.h"

#include "graphics/Renderer.h"
#include "graphics/Graphics.h"

class IniConfig;

Expand All @@ -20,6 +20,7 @@ namespace PiGui {
}

namespace Graphics {
class Renderer;
class RenderTarget;
}

Expand All @@ -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
Expand Down Expand Up @@ -85,4 +88,5 @@ class GuiApplication : public Application {

std::unique_ptr<Graphics::Renderer> m_renderer;
std::unique_ptr<Graphics::RenderTarget> m_renderTarget;
Graphics::Settings m_settings;
};

0 comments on commit 58cc33f

Please sign in to comment.