Shaders now are managed by a manger that can do hot reloading and it also will detect a bad shader and use an ERROR shader so you know it's busted visually.
This commit is contained in:
parent
a5b8e411e3
commit
35ced58cc9
14 changed files with 144 additions and 13 deletions
22
tests/shaders.cpp
Normal file
22
tests/shaders.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <fmt/core.h>
|
||||
#include <string>
|
||||
#include "shaders.hpp"
|
||||
|
||||
using namespace fmt;
|
||||
|
||||
TEST_CASE("shader loading/init works", "[shaders]") {
|
||||
shaders::init();
|
||||
|
||||
sf::Shader* ui_shader = shaders::get("ui_shader");
|
||||
auto other_test = shaders::get("ui_shader");
|
||||
|
||||
REQUIRE(ui_shader != nullptr);
|
||||
REQUIRE(ui_shader == other_test);
|
||||
|
||||
shaders::reload();
|
||||
|
||||
// auto after_reload = shaders::get("ui_shader");
|
||||
// REQUIRE(ui_shader != after_reload);
|
||||
// REQUIRE(other_test != after_reload);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue