tmp
This commit is contained in:
parent
b342f4fd8c
commit
59b1d0b89a
4 changed files with 26 additions and 38 deletions
|
|
@ -1,45 +1,36 @@
|
|||
|
||||
#include "Window.hpp"
|
||||
#include "Graphics.hpp"
|
||||
|
||||
#include "GUI.h"
|
||||
|
||||
using namespace tp;
|
||||
using namespace obj;
|
||||
|
||||
class GUIWindow {
|
||||
Window* window;
|
||||
ObjectsGUI gui;
|
||||
|
||||
public:
|
||||
GUIWindow() {
|
||||
tp::HeapAllocGlobal::startIgnore();
|
||||
window = Window::createWindow(1500, 900, "Objects GUI");
|
||||
tp::HeapAllocGlobal::stopIgnore();
|
||||
|
||||
gui.cd(NDO->create("dict"), "root");
|
||||
}
|
||||
|
||||
void run() {
|
||||
while (!window->shouldClose()) {
|
||||
window->processEvents();
|
||||
gui.draw();
|
||||
window->draw();
|
||||
}
|
||||
}
|
||||
|
||||
~GUIWindow() { Window::destroyWindow(window); }
|
||||
};
|
||||
|
||||
int main() {
|
||||
|
||||
tp::ModuleManifest* deps[] = { &gModuleObjects, &gModuleGraphics, nullptr };
|
||||
tp::ModuleManifest module("ObjectsTests", nullptr, nullptr, deps);
|
||||
|
||||
if (module.initialize()) {
|
||||
auto window = Window::createWindow({ 1500, 900 }, "Objects GUI");
|
||||
|
||||
{
|
||||
GUIWindow window;
|
||||
window.run();
|
||||
Graphics graphics(window);
|
||||
ObjectsGUI gui;
|
||||
|
||||
gui.cd(NDO->create("dict"), "root");
|
||||
|
||||
while (!window->shouldClose()) {
|
||||
window->processEvents();
|
||||
graphics.proc();
|
||||
gui.draw();
|
||||
graphics.draw();
|
||||
window->draw();
|
||||
}
|
||||
}
|
||||
|
||||
Window::destroyWindow(window);
|
||||
|
||||
module.deinitialize();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue