JackEditor/main.cpp

58 lines
959 B
C++
Raw Permalink Normal View History

2024-03-28 16:46:43 +08:00
#include <SFML/System.hpp>
#include <cmath>
#include <cstdlib>
#include <initializer_list>
#include <iostream>
#include <cstdio>
2024-03-30 17:19:32 +08:00
#include <string>
2024-03-28 16:46:43 +08:00
#include <vector>
#include "gui/gui.hpp"
#include "gui/imgui/imgui.h"
#include "gui/imgui/imgui_stdlib.h"
#include "types.hpp"
using namespace std;
2024-04-02 15:20:37 +08:00
void ui_bundle();
void ui_map();
2024-03-30 17:19:32 +08:00
2024-03-28 16:46:43 +08:00
int main(int argc, char *argv[]) {
2024-04-11 21:19:24 +08:00
UI ui(sf::Vector2u(1400, 1000), "JackEditor");
2024-03-28 16:46:43 +08:00
while (ui.Update()) {
2024-04-02 15:20:37 +08:00
static bool demo_open = false;
static bool bundleOpen = false, mapOpen = true;
ig::BeginMainMenuBar();
ig::Checkbox("Demo Window", &demo_open);
ig::Separator();
ig::Checkbox("Bundle", &bundleOpen);
ig::Separator();
ig::Checkbox("Map", &mapOpen);
ig::EndMainMenuBar();
if (demo_open)
ig::ShowDemoWindow(&demo_open);
2024-04-11 21:19:24 +08:00
if (bundleOpen) {
ig::PushID(1);
2024-04-02 15:20:37 +08:00
ui_bundle();
2024-04-11 21:19:24 +08:00
ig::PopID();
}
if (mapOpen) {
ig::PushID(2);
ui_map();
ig::PopID();
}
2024-03-28 16:46:43 +08:00
ui.Render();
}
return 0;
}