Intermediate refactor to move everything over to using the textures module rather than everyone using one TexturePack thing.

This commit is contained in:
Zed A. Shaw 2025-02-21 03:00:56 -05:00
parent 6c1d851e85
commit f3e1413022
23 changed files with 129 additions and 64 deletions

View file

@ -8,9 +8,7 @@ using namespace guecs;
TEST_CASE("prototype one gui", "[ecs-gui]") {
guecs::UI gui;
TexturePack textures;
textures.load_sprites();
textures::init();
gui.position(0, 0, 1000, 500);
gui.layout("[test1|test2|test3][test4|_|test5]");
@ -24,7 +22,7 @@ TEST_CASE("prototype one gui", "[ecs-gui]") {
world.set<Textual>(button, {name});
}
gui.init(textures);
gui.init();
// at this point it's mostly ready but I'd need to render it to a window real quick
sf::RenderWindow window;

17
tests/textures.cpp Normal file
View file

@ -0,0 +1,17 @@
#include <catch2/catch_test_macros.hpp>
#include <fmt/core.h>
#include <string>
#include "textures2.hpp"
using namespace fmt;
TEST_CASE("test texture management", "[textures]") {
textures::init();
auto spider = textures::get("hairy_spider");
auto image = textures::load_image("assets/hairy_spider-256.png");
auto img_ptr = textures::get_surface(0);
REQUIRE(img_ptr != nullptr);
}