diff --git a/README.md b/README.md index e82d9d1..08e444f 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ This project is my experiment project to use ImGui, ImPlot, futhark and so on wi - Notice It may be better to use the **mainstream** project [nimgl/imgui](https://github.com/nimgl/imgui) (ImGui v1.85) -,updated project [nimgl-imgui](https://github.com/dinau/nimgl-imgui) (ImGui v1.89.9) -,sub project [nim_implot](https://github.com/dinau/nim_implot) and test project [nimgl_test](https://github.com/dinau/nimgl_test). +,updated project [nimgl-imgui](https://github.com/dinau/nimgl-imgui) (ImGui v1.89.9) ,sub project [nim_implot](https://github.com/dinau/nim_implot) and test project [nimgl_test](https://github.com/dinau/nimgl_test), +or [https://github.com/daniel-j/nimgl-imgui](https://github.com/daniel-j/nimgl-imgui) (ImGui v1.91.1) #### Screen shot @@ -43,7 +43,7 @@ See example project [ImGuin_examples](https://github.com/dinau/imguin_examples) - [Nim-2.0.14](https://nim-lang.org) or later - Windows10 or later [MSys2/MinGW](https://www.msys2.org/) command line tools (Unix tools), make, cp, rm, git, ...etc -- Ubuntu / Debian families +- Linux: Ubuntu / Debian families ```sh $ sudo apt install gcc g++ make git @@ -83,7 +83,7 @@ nimble install https://github.com/dinau/imguin | ------------------- | :----: | :---- | :----: | --- | | OpenGL3
backend | v | v | v | Done. | | SDL2
backend | - | v | - | Done. 2025 | - | SDL3
backend | - | - | WIP | | + | SDL3
backend | - | - | v | Done. 2025 | #### Update / Downgrade Dear ImGui and CImGui diff --git a/src/img/fontxv2_demo.png b/src/img/fontx2v_demo.png similarity index 100% rename from src/img/fontxv2_demo.png rename to src/img/fontx2v_demo.png diff --git a/src/imguin/impl_sdl3.nim b/src/imguin/impl_sdl3.nim index 0b55a3c..0421b2d 100644 --- a/src/imguin/impl_sdl3.nim +++ b/src/imguin/impl_sdl3.nim @@ -30,6 +30,7 @@ type ImGui_ImplSDL3_GamepadMode_Manual = 2 ImGui_ImplSDL3_GamepadMode* = enum_ImGui_ImplSDL3_GamepadMode +{.push discardable.} proc ImGui_ImplSDL3_InitForOpenGL*(window: ptr SDL_Window; sdl_gl_context: pointer): bool {.cdecl, importc: "ImGui_ImplSDL3_InitForOpenGL".} proc ImGui_ImplSDL3_InitForVulkan*(window: ptr SDL_Window): bool {.cdecl, importc: "ImGui_ImplSDL3_InitForVulkan".} proc ImGui_ImplSDL3_InitForD3D*(window: ptr SDL_Window): bool {.cdecl, importc: "ImGui_ImplSDL3_InitForD3D".} @@ -40,3 +41,4 @@ proc ImGui_ImplSDL3_Shutdown*(): void {.cdecl, importc: "ImGui_ImplSDL3_Shutdown proc ImGui_ImplSDL3_NewFrame*(): void {.cdecl, importc: "ImGui_ImplSDL3_NewFrame".} proc ImGui_ImplSDL3_ProcessEvent*(event: ptr SDL_Event): bool {.cdecl, importc: "ImGui_ImplSDL3_ProcessEvent".} proc ImGui_ImplSDL3_SetGamepadMode*(mode: ImGui_ImplSDL3_GamepadMode; manual_gamepads_array: ptr ptr SDL_Gamepad; manual_gamepads_count: cint): void {.cdecl, importc: "ImGui_ImplSDL3_SetGamepadMode".} +{.pop.} diff --git a/src/imguin/impl_sdlrenderer3.nim b/src/imguin/impl_sdlrenderer3.nim index b61efb0..6c6a2ee 100644 --- a/src/imguin/impl_sdlrenderer3.nim +++ b/src/imguin/impl_sdlrenderer3.nim @@ -23,10 +23,11 @@ else: const ImguiRootPath = joinPath(CImguiRootPath,"imgui").replace("\\", "/") {.compile:joinPath(ImguiRootPath,"backends/imgui_impl_sdlrenderer3.cpp").replace("\\", "/").} type - structsdlrenderer {.incompleteStruct.} = object - SDL_Renderer = structsdlrenderer - ImDrawData {.incompleteStruct.} = object + #struct_SDL_Renderer {.incompleteStruct.} = object + #SDL_Renderer = structsdlrenderer + ImDrawData* {.incompleteStruct.} = object +{.push discardable.} proc ImGui_ImplSDLRenderer3_Init*(renderer: ptr SDL_Renderer): bool {.cdecl, importc: "ImGui_ImplSDLRenderer3_Init".} proc ImGui_ImplSDLRenderer3_Shutdown*(): void {.cdecl, importc: "ImGui_ImplSDLRenderer3_Shutdown".} proc ImGui_ImplSDLRenderer3_NewFrame*(): void {.cdecl, importc: "ImGui_ImplSDLRenderer3_NewFrame".} @@ -35,3 +36,4 @@ proc ImGui_ImplSDLRenderer3_CreateFontsTexture*(): bool {.cdecl, importc: "ImGui proc ImGui_ImplSDLRenderer3_DestroyFontsTexture*(): void {.cdecl, importc: "ImGui_ImplSDLRenderer3_DestroyFontsTexture".} proc ImGui_ImplSDLRenderer3_CreateDeviceObjects*(): bool {.cdecl, importc: "ImGui_ImplSDLRenderer3_CreateDeviceObjects".} proc ImGui_ImplSDLRenderer3_DestroyDeviceObjects*(): void {.cdecl, importc: "ImGui_ImplSDLRenderer3_DestroyDeviceObjects".} +{.pop.} diff --git a/src/imguin/sdl3_renderer.nim b/src/imguin/sdl3_renderer.nim new file mode 100644 index 0000000..ee4fb1c --- /dev/null +++ b/src/imguin/sdl3_renderer.nim @@ -0,0 +1,4 @@ +# This file exsists for only compatibility purpose. + +import cimgui, impl_sdl3, impl_sdlrenderer3 +export cimgui, impl_sdl3, impl_sdlrenderer3 diff --git a/src/imguin/sdl_basetype.nim b/src/imguin/sdl_basetype.nim index 206d2f7..fdbeb2e 100644 --- a/src/imguin/sdl_basetype.nim +++ b/src/imguin/sdl_basetype.nim @@ -4,10 +4,10 @@ type struct_SDL_Gamecontroller* {.incompleteStruct.} = object internal_SDL_GameController* = structsdlgamecontroller ## Generated based on cimgui_impl.h:50:36 ImGui_ImplSDL2_Gamepadmode* = enum_ImGui_implSDL2_GamePadMode ## Generated based on cimgui_impl.h:55:125 - unionSDLEvent* {.incompleteStruct.} = object - SDL_Window* = structsdlwindow ## Generated based on cimgui_impl.h:48:27 - SDL_Event* = unionsdlevent ## Generated based on cimgui_impl.h:54:25 - SDL_Renderer* = structsdlrenderer + union_SDL_Event* {.incompleteStruct.} = object + SDL_Window* = struct_SDL_Window ## Generated based on cimgui_impl.h:48:27 + SDL_Event* = union_SDL_Event ## Generated based on cimgui_impl.h:54:25 + SDL_Renderer* = struct_SDL_Renderer ImDrawData* {.incompleteStruct.} = object enum_ImGui_implSDL2_GamepadMode* {.size: sizeof(cuint).} = enum