-
Notifications
You must be signed in to change notification settings - Fork 0
/
Demo.cpp
47 lines (30 loc) · 801 Bytes
/
Demo.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <Flexium/World.hpp>
#include <Flexium/Window.hpp>
#include <Flexium/Object.hpp>
#include <Flexium/Text.hpp>
#include <FlexiumImGUI.hpp>
class FlexGUITest : public flx::Object {
private:
bool show_window;
public:
FlexGUITest(): show_window(true) {};
virtual void onUpdate() {
// This is a demo built into ImGUI
ImGui::ShowTestWindow(&show_window);
}
};
int main() {
// Create the window
flx::Window::WindowSettings ws;
ws.title = "Flexium and ImGUI";
flx::Window::setClearColor(sf::Color::White);
flx::Window::initiate(ws);
// Load resources
flx::Text::loadMapping("fontsheet.xml");
// Setup the world
flx::World world;
world.instanceAdd(new FlexGUI());
// This is our interface.
world.instanceAdd(new FlexGUITest());
while (world.simulate());
}