aboutsummaryrefslogtreecommitdiff
path: root/vendor/rlImGui-main/examples/simple.cpp
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2024-09-06 22:29:38 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2024-09-06 22:29:38 -0500
commit52a2f5b69eaf3430623ef2ebeeca0c50a3b8217c (patch)
tree0fc74f5b192d74452ad74f22ad512b8b663d2139 /vendor/rlImGui-main/examples/simple.cpp
parentad6d55aeaa7c87a4008e56a5a3922d2608c73239 (diff)
downloadparticle-sim-52a2f5b69eaf3430623ef2ebeeca0c50a3b8217c.tar.gz
Quickfix: rlimgui bindings added to vendor/
Diffstat (limited to 'vendor/rlImGui-main/examples/simple.cpp')
-rw-r--r--vendor/rlImGui-main/examples/simple.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/vendor/rlImGui-main/examples/simple.cpp b/vendor/rlImGui-main/examples/simple.cpp
new file mode 100644
index 0000000..849ecef
--- /dev/null
+++ b/vendor/rlImGui-main/examples/simple.cpp
@@ -0,0 +1,59 @@
+/*******************************************************************************************
+*
+* raylib-extras [ImGui] example - Simple Integration
+*
+* This is a simple ImGui Integration
+* It is done using C++ but with C style code
+* It can be done in C as well if you use the C ImGui wrapper
+* https://github.com/cimgui/cimgui
+*
+* Copyright (c) 2021 Jeffery Myers
+*
+********************************************************************************************/
+
+#include "raylib.h"
+#include "raymath.h"
+
+#include "imgui.h"
+#include "rlImGui.h"
+
+int main(int argc, char* argv[])
+{
+ // Initialization
+ //--------------------------------------------------------------------------------------
+ int screenWidth = 1280;
+ int screenHeight = 800;
+
+ SetConfigFlags(FLAG_MSAA_4X_HINT | FLAG_VSYNC_HINT | FLAG_WINDOW_RESIZABLE);
+ InitWindow(screenWidth, screenHeight, "raylib-Extras [ImGui] example - simple ImGui Demo");
+ SetTargetFPS(144);
+ rlImGuiSetup(true);
+
+ // Main game loop
+ while (!WindowShouldClose()) // Detect window close button or ESC key
+ {
+ BeginDrawing();
+ ClearBackground(DARKGRAY);
+
+ // start ImGui Conent
+ rlImGuiBegin();
+
+ // show ImGui Content
+ bool open = true;
+ ImGui::ShowDemoWindow(&open);
+
+ // end ImGui Content
+ rlImGuiEnd();
+
+ EndDrawing();
+ //----------------------------------------------------------------------------------
+ }
+ rlImGuiShutdown();
+
+ // De-Initialization
+ //--------------------------------------------------------------------------------------
+ CloseWindow(); // Close window and OpenGL context
+ //--------------------------------------------------------------------------------------
+
+ return 0;
+} \ No newline at end of file