Forgot a ton of files in the last commit.
This commit is contained in:
parent
f5f5ca6431
commit
df024adccd
24 changed files with 560 additions and 0 deletions
26
tests/shaders.cpp
Normal file
26
tests/shaders.cpp
Normal file
|
@ -0,0 +1,26 @@
|
|||
#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();
|
||||
int version = shaders::version();
|
||||
|
||||
std::shared_ptr<sf::Shader> ui_shader = shaders::get("ui_shader");
|
||||
auto other_test = shaders::get("ui_shader");
|
||||
|
||||
REQUIRE(ui_shader != nullptr);
|
||||
REQUIRE(ui_shader == other_test);
|
||||
REQUIRE(shaders::updated(version) == false);
|
||||
|
||||
int new_version = shaders::reload();
|
||||
REQUIRE(version != shaders::version());
|
||||
REQUIRE(version != new_version);
|
||||
REQUIRE(shaders::version() == new_version);
|
||||
REQUIRE(shaders::updated(version) == true);
|
||||
version = new_version;
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue