osg stable
This commit is contained in:
parent
5c18a10d11
commit
bfbdd0e33b
1 changed files with 21 additions and 18 deletions
|
|
@ -1,36 +1,39 @@
|
||||||
|
|
||||||
#include "Graphics.hpp"
|
#include "GraphicApplication.hpp"
|
||||||
|
|
||||||
#include "GUI.h"
|
#include "GUI.h"
|
||||||
|
|
||||||
using namespace tp;
|
using namespace tp;
|
||||||
using namespace obj;
|
using namespace obj;
|
||||||
|
|
||||||
|
class ExampleGUI : public Application {
|
||||||
|
public:
|
||||||
|
ExampleGUI() {
|
||||||
|
gui.cd(NDO->create("dict"), "root");
|
||||||
|
}
|
||||||
|
|
||||||
|
void processFrame(EventHandler* eventHandler) override {
|
||||||
|
}
|
||||||
|
|
||||||
|
void drawFrame(Canvas* canvas) override {
|
||||||
|
canvas->rect({ { 0, 0 }, mWindow->getSize() }, RGBA(0.f, 0.f, 0.f, 1.f), 0);
|
||||||
|
gui.draw();
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
ObjectsGUI gui;
|
||||||
|
};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
tp::ModuleManifest* deps[] = { &gModuleObjects, &gModuleGraphics, nullptr };
|
tp::ModuleManifest* deps[] = { &gModuleObjects, &gModuleGraphics, nullptr };
|
||||||
tp::ModuleManifest module("ObjectsTests", nullptr, nullptr, deps);
|
tp::ModuleManifest module("ObjectsTests", nullptr, nullptr, deps);
|
||||||
|
|
||||||
if (module.initialize()) {
|
if (module.initialize()) {
|
||||||
auto window = Window::createWindow({ 1500, 900 }, "Objects GUI");
|
|
||||||
|
|
||||||
{
|
{
|
||||||
Graphics graphics(window);
|
ExampleGUI gui;
|
||||||
ObjectsGUI gui;
|
gui.run();
|
||||||
|
|
||||||
gui.cd(NDO->create("dict"), "root");
|
|
||||||
|
|
||||||
while (!window->shouldClose()) {
|
|
||||||
window->processEvents();
|
|
||||||
graphics.proc();
|
|
||||||
gui.draw();
|
|
||||||
graphics.draw();
|
|
||||||
window->draw();
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Window::destroyWindow(window);
|
|
||||||
|
|
||||||
module.deinitialize();
|
module.deinitialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue