diff options
Diffstat (limited to 'themes/src/winter')
-rw-r--r-- | themes/src/winter/WinterTheme.cpp | 16 | ||||
-rw-r--r-- | themes/src/winter/WinterTheme.hpp | 9 |
2 files changed, 13 insertions, 12 deletions
diff --git a/themes/src/winter/WinterTheme.cpp b/themes/src/winter/WinterTheme.cpp index 69e7e69..052670e 100644 --- a/themes/src/winter/WinterTheme.cpp +++ b/themes/src/winter/WinterTheme.cpp @@ -1,10 +1,10 @@ #include "WinterTheme.hpp" #include "../Renderer2d.h" -WinterTheme::WinterTheme(Renderer2d* renderer) - : renderer{renderer} +WinterTheme::WinterTheme(WebglContext* context) { - load(renderer); + renderer.load(context); + load(); } WinterTheme::~WinterTheme() @@ -12,10 +12,10 @@ WinterTheme::~WinterTheme() unload(); } -void WinterTheme::load(Renderer2d* renderer) { - renderer->clearColor = Vector4(200, 229, 239, 255).toNormalizedColor(); +void WinterTheme::load() { + renderer.clearColor = Vector4(200, 229, 239, 255).toNormalizedColor(); SnowflakeLoadParameters lp; - spr.load(lp, renderer); + spr.load(lp, &renderer); } void WinterTheme::update(f32 dtSeconds) { @@ -23,8 +23,8 @@ void WinterTheme::update(f32 dtSeconds) { } void WinterTheme::render() { - renderer->render(); - spr.render(renderer); + renderer.render(); + spr.render(&renderer); } void WinterTheme::unload() { diff --git a/themes/src/winter/WinterTheme.hpp b/themes/src/winter/WinterTheme.hpp index 7e5f2ef..5ba6d94 100644 --- a/themes/src/winter/WinterTheme.hpp +++ b/themes/src/winter/WinterTheme.hpp @@ -4,21 +4,22 @@ #include "Snowflake.h" #include "../types.h" #include "../theme.h" +#include "../Renderer2d.h" -struct Renderer2d; +struct WebglContext; struct WinterTheme : public Theme { public: - WinterTheme(Renderer2d* renderer); + WinterTheme(WebglContext*); ~WinterTheme(); SnowflakeParticleRenderer spr; - void load(Renderer2d* renderer); + void load(); void update(f32 dtSeconds); void render(); void unload(); private: - Renderer2d* renderer; + Renderer2d renderer; }; #endif |