45 lines
762 B
C++
45 lines
762 B
C++
|
|
#include "ExampleGUI.hpp"
|
|
|
|
#include "GraphicApplication.hpp"
|
|
|
|
using namespace tp;
|
|
|
|
class ExampleGUI : public Application {
|
|
public:
|
|
ExampleGUI() = default;
|
|
|
|
void processFrame(EventHandler* eventHandler) override {
|
|
auto rec = RectF( { 0, 0 }, mWindow->getSize() );
|
|
mGui.proc(*eventHandler, rec, rec);
|
|
}
|
|
|
|
void drawFrame(Canvas* canvas) override {
|
|
mGui.draw(*canvas);
|
|
}
|
|
|
|
private:
|
|
ComplexWidget<EventHandler, Canvas> mGui;
|
|
};
|
|
|
|
int main() {
|
|
|
|
tp::ModuleManifest* deps[] = { &tp::gModuleWidgets, nullptr };
|
|
tp::ModuleManifest binModule("Chat", nullptr, nullptr, deps);
|
|
|
|
if (!binModule.initialize()) {
|
|
return 1;
|
|
}
|
|
|
|
{
|
|
GlobalGUIConfig mConfig;
|
|
gGlobalGUIConfig = &mConfig;
|
|
|
|
{
|
|
ExampleGUI gui;
|
|
gui.run();
|
|
}
|
|
}
|
|
|
|
binModule.deinitialize();
|
|
}
|