-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
32 lines (23 loc) · 696 Bytes
/
Copy pathmain.cpp
File metadata and controls
32 lines (23 loc) · 696 Bytes
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
#include "imgui.h"
#include <memory>
#include "window.h"
static void onUpdateCallback();
// Main code
int main(int, char **) {
std::shared_ptr<engine::window> myWindow = std::make_shared<engine::window>(500, 500);
myWindow->registerOnUpdateCallback(onUpdateCallback);
if (myWindow->create() == 0) {
myWindow->update();
}
myWindow->cleanup();
return 0;
}
static void onUpdateCallback() {
auto flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize;
ImGui::Begin("Button 1", nullptr, flags);
ImGui::Button("Press me!");
ImGui::End();
ImGui::Begin("Button 2", nullptr, flags);
ImGui::Button("Press me!");
ImGui::End();
}