diff options
| -rw-r--r-- | examples/config.nims | 1 | ||||
| -rw-r--r-- | examples/simple.nim | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/examples/config.nims b/examples/config.nims new file mode 100644 index 0000000..80091ff --- /dev/null +++ b/examples/config.nims @@ -0,0 +1 @@ +switch("path", "$projectDir/../src") diff --git a/examples/simple.nim b/examples/simple.nim new file mode 100644 index 0000000..d76c716 --- /dev/null +++ b/examples/simple.nim @@ -0,0 +1,36 @@ +import foolib/[raylib, imgui] + +InitWindow(1024, 768, "hello") + +SetTargetFPS(60) + +discard imgui.CreateContext() +imgui.StyleColorsDark() + +when defined(macos): + discard ImGui_ImplOpenGL3_Init("#version 150") +else: + discard ImGui_ImplOpenGL3_Init("#version 130") +discard ImGui_ImplRaylib_Init() + +while not WindowShouldClose(): + ImGui_ImplOpenGL3_NewFrame() + ImGui_ImplRaylib_NewFrame() + imgui.NewFrame() + + BeginDrawing() + + ClearBackground(WHITE) + + imgui.ShowDemoWindow(nil) + + imgui.Render() + + ImGui_ImplOpenGL3_RenderDrawData(imgui.GetDrawData()) + + EndDrawing() + +ImGui_ImplRaylib_Shutdown() +ImGui_ImplOpenGL3_Shutdown() + +CloseWindow() |
