The next little game in the series where I make a fancy rogue game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
roguish/tests/render.cpp

46 lines
971 B

#include <catch2/catch_test_macros.hpp>
#include <fmt/core.h>
#include "render.hpp"
#include "panel.hpp"
#include "map.hpp"
#include "worldbuilder.hpp"
#include "config.hpp"
#include "components.hpp"
#include "systems.hpp"
#include "save.hpp"
using namespace ftxui;
using namespace fmt;
using namespace components;
using namespace lighting;
using std::string;
void run_renderer(SFMLRender &renderer, Panel &panel) {
panel.render();
renderer.display();
REQUIRE(renderer.is_open() == true);
renderer.clear();
renderer.draw(panel);
}
TEST_CASE("can render a text panel", "[render]") {
SFMLRender renderer;
renderer.init_terminal();
Panel panel(0, 0, 20, 5);
auto text_box = Renderer([]{
return hbox({
hflow(
vbox(text("I AM TEXT"))
)});
});
panel.set_renderer(text_box);
run_renderer(renderer, panel);
renderer.close();
}
TEST_CASE("can render a grid", "[render]") {
dbc::log("!!!! NEEDS A REWRITE");
}