From 1c5eb68d2d791c87a2030e4b17fb26bdd7931888 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 27 Aug 2023 09:59:06 +0200 Subject: draw, main, shaders: now use shaders/tuc --- main/main-impl.hpp | 6 +++++- main/setup.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'main') 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_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) { -- cgit v1.2.3