40 lines
1.0 KiB
C++
40 lines
1.0 KiB
C++
// Hammer++ - map editor built on raylib + Dear ImGui (rlImGui) + libhmap.
|
|
#include "editor.h"
|
|
#include "imgui.h"
|
|
#include "raylib.h"
|
|
#include "rlImGui.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
SetConfigFlags(FLAG_WINDOW_RESIZABLE | FLAG_VSYNC_HINT | FLAG_MSAA_4X_HINT);
|
|
InitWindow(1600, 900, "Hammer++");
|
|
SetWindowMinSize(960, 600);
|
|
SetExitKey(KEY_NULL); // Esc cancels tools instead of quitting
|
|
|
|
rlImGuiSetup(true);
|
|
ImGuiIO& io = ImGui::GetIO();
|
|
#ifdef IMGUI_HAS_DOCK
|
|
io.ConfigFlags |= ImGuiConfigFlags_DockingEnable;
|
|
#endif
|
|
io.IniFilename = "hammerpp.ini";
|
|
io.ConfigWindowsMoveFromTitleBarOnly = true;
|
|
hpp::applyTheme();
|
|
|
|
hpp::Editor editor;
|
|
editor.init();
|
|
if (argc > 1) editor.openMap(argv[1]);
|
|
|
|
while (!WindowShouldClose() && !editor.wantQuit) {
|
|
BeginDrawing();
|
|
ClearBackground(Color{20, 22, 27, 255});
|
|
rlImGuiBegin();
|
|
editor.frame();
|
|
rlImGuiEnd();
|
|
EndDrawing();
|
|
}
|
|
|
|
editor.shutdown();
|
|
rlImGuiShutdown();
|
|
CloseWindow();
|
|
return 0;
|
|
}
|