add demo
This commit is contained in:
parent
7014243974
commit
0d27eb2c86
@ -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/)
|
||||
|
||||
|
39
demo.cpp
Normal file
39
demo.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
#include <raylib.h>
|
||||
#include <imgui.h>
|
||||
#include <rlImGui.h>
|
||||
|
||||
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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user