diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b29bec..42a89b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,3 +82,7 @@ set(public_headers file(COPY ${public_headers} DESTINATION "include") +add_executable(main demo.cpp) +target_link_libraries(main raylib imgui) +target_include_directories(main PRIVATE build/include/) + diff --git a/demo.cpp b/demo.cpp new file mode 100644 index 0000000..989eb1c --- /dev/null +++ b/demo.cpp @@ -0,0 +1,39 @@ +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int screenWidth = 1000; + int screenHeight = 1000; + + SetConfigFlags(FLAG_WINDOW_RESIZABLE); + InitWindow(screenWidth, screenHeight, "VIEW"); + SetTargetFPS(60); + rlImGuiSetup(true); + bool showDemoWindow = true; + ImGui::GetIO().ConfigFlags |= ImGuiConfigFlags_DockingEnable; + + while (!WindowShouldClose()) + { + BeginDrawing(); + rlImGuiBegin(); + ImGui::DockSpaceOverViewport(0, NULL, ImGuiDockNodeFlags_PassthruCentralNode); + ClearBackground(RAYWHITE); + if (ImGui::BeginMainMenuBar()) + { + if (ImGui::MenuItem("Demo Window", nullptr, showDemoWindow)) + showDemoWindow = !showDemoWindow; + + ImGui::EndMainMenuBar(); + } + + if (showDemoWindow) + ImGui::ShowDemoWindow(&showDemoWindow); + rlImGuiEnd(); + EndDrawing(); + } + rlImGuiShutdown(); + CloseWindow(); + return 0; +} \ No newline at end of file