Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
prism/engine/core/include/screen.hpp

43 lines
970 B
C++
Raw Normal View History

2020-08-11 12:07:21 -04:00
#pragma once
#include <string>
#include <vector>
#include <map>
#include <functional>
#include "uielement.hpp"
#include "file.hpp"
class GFXBuffer;
namespace ui {
class Screen {
public:
Screen() {}
Screen(const file::Path path);
void process_event(const std::string& type, std::string data = "");
void process_mouse(const int x, const int y);
void calculate_sizes();
std::vector<UIElement> elements;
UIElement* find_element(const std::string& id);
using CallbackFunction = std::function<void()>;
std::map<std::string, CallbackFunction> listeners;
bool blurs_background = false;
void add_listener(const std::string& id, std::function<void()> callback);
2020-08-13 07:48:50 -04:00
prism::Extent extent;
2020-08-11 12:07:21 -04:00
bool view_changed = false;
GFXBuffer* glyph_buffer = nullptr;
GFXBuffer* instance_buffer = nullptr;
GFXBuffer* elements_buffer = nullptr;
};
}