ini
This commit is contained in:
parent
f7f0d6e5be
commit
83d51d3e83
30 changed files with 1186 additions and 208 deletions
46
Widgets/examples/Entry.cpp
Normal file
46
Widgets/examples/Entry.cpp
Normal 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();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue