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/panel.hpp

41 lines
1.0 KiB

#pragma once
#include <ftxui/dom/node.hpp> // for Render
#include <ftxui/component/component.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/dom/canvas.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/dom/canvas.hpp>
#include <ftxui/screen/screen.hpp>
#include <ftxui/dom/canvas.hpp>
#include <locale>
#include <codecvt>
using ftxui::Renderer, ftxui::Component, ftxui::Element, ftxui::Screen;
struct Panel {
int x;
int y;
int width;
int height;
std::wstring $screenout;
bool $dirty = true;
Component $component;
Screen $screen;
bool $must_clear = true;
std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> $converter;
Panel(int width, int height, int x, int y, bool must_clear=true) :
x(x),
y(y),
width(width),
height(height),
$screen(width, height),
$must_clear(must_clear)
{};
void resize(int width, int height);
void set_renderer(std::function< Element()> render);
void render();
const std::wstring &to_string();
const Screen &screen();
};