diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-27 09:59:06 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-08-27 13:13:57 +0200 |
commit | 1c5eb68d2d791c87a2030e4b17fb26bdd7931888 (patch) | |
tree | 93086d7eb082f8a7d36840688eca87b42e4ba501 /main | |
parent | 2a527f27e22ae35d4d8fccc66451745c7c93d1f9 (diff) |
draw, main, shaders: now use shaders/tuc
Diffstat (limited to 'main')
-rw-r--r-- | main/main-impl.hpp | 6 | ||||
-rw-r--r-- | main/setup.cpp | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/main/main-impl.hpp b/main/main-impl.hpp index 2afac162..6e416549 100644 --- a/main/main-impl.hpp +++ b/main/main-impl.hpp @@ -5,6 +5,7 @@ #include "draw/floor.hpp" #include "draw/wall.hpp" #include "draw/anim.hpp" +#include "shaders/texture-unit-cache.hpp" #include "shaders/shader.hpp" #include "shaders/lightmap.hpp" #include "main/clickable.hpp" @@ -94,12 +95,15 @@ struct main_impl final : Platform::Sdl2Application, floormat_main void set_cursor(uint32_t cursor) noexcept override; uint32_t cursor() const noexcept override; + struct texture_unit_cache& texture_unit_cache() override { return _tuc; } + private: + struct texture_unit_cache _tuc; fm_settings s; [[maybe_unused]] char _dummy = (register_debug_callback(), '\0'); floormat_app& app; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members) tile_shader _shader; - struct lightmap_shader _lightmap_shader; + struct lightmap_shader _lightmap_shader{_tuc}; std::vector<clickable> _clickable_scenery; struct world _world{}; Magnum::Timeline timeline; diff --git a/main/setup.cpp b/main/setup.cpp index 93f3b943..15b34b2b 100644 --- a/main/setup.cpp +++ b/main/setup.cpp @@ -9,7 +9,7 @@ namespace floormat { main_impl::main_impl(floormat_app& app, fm_settings&& se, int& argc, char** argv) noexcept : Platform::Sdl2Application{Arguments{argc, argv}, make_conf(se), make_gl_conf(se)}, - s{std::move(se)}, app{app} + s{std::move(se)}, app{app}, _shader{_tuc} { if (s.vsync) { |