summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ui/gameMainWindow.cpp6
-rw-r--r--ui/gameMainWindow.h1
-rw-r--r--ui/window.h3
3 files changed, 10 insertions, 0 deletions
diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp
index 3617ca8..c84781c 100644
--- a/ui/gameMainWindow.cpp
+++ b/ui/gameMainWindow.cpp
@@ -71,3 +71,9 @@ GameMainWindow::render() const
gameState->world.apply<Renderable>(&Renderable::render, shader);
Window::render();
}
+
+const Shader &
+GameMainWindow::getShader() const
+{
+ return shader;
+}
diff --git a/ui/gameMainWindow.h b/ui/gameMainWindow.h
index 68ad7ad..9cc72ab 100644
--- a/ui/gameMainWindow.h
+++ b/ui/gameMainWindow.h
@@ -15,6 +15,7 @@ public:
void render() const override;
private:
+ const Shader & getShader() const override;
Shader shader;
Camera camera;
};
diff --git a/ui/window.h b/ui/window.h
index b6ade60..f808588 100644
--- a/ui/window.h
+++ b/ui/window.h
@@ -10,6 +10,8 @@
#include <special_members.hpp>
#include <string>
+class Shader;
+
class Window {
public:
Window(size_t width, size_t height, const std::string & title);
@@ -28,6 +30,7 @@ public:
protected:
[[nodiscard]] SDL_GLContext glContext() const;
virtual void render() const;
+ virtual const Shader & getShader() const = 0;
using SDL_WindowPtr = wrapped_ptrt<SDL_Window, SDL_CreateWindow, SDL_DestroyWindow>;
SDL_WindowPtr m_window;