This commit is contained in:
Ilusha 2024-01-18 09:15:22 +03:00 committed by Ilya Shurupov
parent 466c0c36bd
commit 5106cc3b71
30 changed files with 1186 additions and 208 deletions

View file

@ -0,0 +1,46 @@
#include "ExampleGUI.hpp"
#include "Window.hpp"
using namespace tp;
void runApp() {
auto window = tp::Window::createWindow(800, 600, "Window 1");
tp::ComplexWidget<tp::Window::Events, tp::Graphics::Canvas> gui;
if (window) {
while (!window->shouldClose()) {
window->processEvents();
auto area = window->getCanvas().getAvaliableArea();
gui.proc(window->getEvents(), {}, { area.x, area.y, area.z, area.w });
gui.draw(window->getCanvas());
tp::sleep(20);
window->draw();
}
}
tp::Window::destroyWindow(window);
}
int main() {
tp::ModuleManifest* deps[] = { &tp::gModuleWidgets, nullptr };
tp::ModuleManifest binModule("Chat", nullptr, nullptr, deps);
if (!binModule.initialize()) {
return 1;
}
{
tp::GlobalGUIConfig config;
tp::gGlobalGUIConfig = &config;
runApp();
}
binModule.deinitialize();
}