/ruby-imgui-dev

Yet another ImGui wrapper for Ruby

Primary LanguageC++OtherNOASSERTION

Dev. version: Yet another ImGui wrapper for Ruby


Currently highly work in progress

alt

Purpouses


This project is based on and forked awesome work
Yet another ImGui wrapper for Ruby: vaiorabbit's ruby-imgui: imgui-bindings .

The purpouses are

  • Windows11 or later

  • Linux: Debian13 Trixie and Ubuntu families

  • imgui.dll/so may be divided to

    DLL Backend FFI Contents (CImGui +)
    imgui.dll/so impl_glfw.rb
    impl_opengl3.rb
    imgui_impl_glfw.cpp
    imgui_impl_opengl3.cpp
    imgui_sdl2.dll/so impl_sdl2.rb
    impl_opengl3.rb
    impl_sdlrender2.rb
    imgui_impl_sdl2.cpp
    imgui_impl_opengl3.cpp
    so on
    imgui_sdl3.dll/so impl_sdl3.rb
    impl_opengl3.rb
    impl_sdlrenderer3.rb
    impl_sdlgpu3.rb
    imgui_impl_sdl3.cpp
    imgui_impl_opengl3.cpp
    so on
  • Status: Additional libraries included in *.dll/so,1

    • ImGuiColorTextEdit
    • ImGui_Toggle
    • ImGui-Knobs
    • ImGuizmo
    • ImSpinner
    • ImNodes
    • ImGuiFileDialog
    • ImPlot
    • ImPlot3D
  • Enable CJK Input method IME flag -D IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS

  • Set ImDrawIdx to 32bit type for ImPlot / ImPlot3D

Prerequisites


  • WindowsOS 10 or later
    Use RubyInstaller + Devkit 3.4.6 or later : https://rubyinstaller.org/downloads/

  • LinuxOS: Debian13 Trixie

    $ sudo apt install ruby-dev
    $ sudo apt install clang git make ninja-build
    $ sudo apt install lib{opengl-dev,gl1-mesa-dev,glfw3,glfw3-dev,xcursor-dev,xinerama-dev,xi-dev}
    $ sudo apt install libsdl2-dev libsdl3-dev

Executing example programs


First see igruby_examples

Download files,

pwd 
my_dev_folder
git clone --recursive https://github.com/dinau/ruby-imgui-dev

Folder structure,

my_dev_folder
 |--- igruby_examples
 `--- ruby-imgui-dev

Install libraries with bundle,

cd igruby_examples
bundle install 

Execute one of examples,

pwd 
igruby_examples
cd glfw_opengl3     
r.bat           # or double click glfw_oepngl3.rbw in Windows file explorer

Note: Only supported under bundler enviroment at this moment

Building DLLs by yourself


If you'd like to build Dlls by yourself,

  • Install Ruby Devkit or MSys/MinGW, at least

    pacman -S make mingw-w64-ucrt-x86_64-{cmake,gcc,clang,SDL2,sdl3,pkg-config,glfw,ninja} 
  • Clang 21.1.1 : Default compiler

  • (GCC 15.2.0)

  • Build DLLs

    pwd
    ruby-imgui-dev
    cd imgui_dll
    make

Screenshots


See igRuby example project

alt
alt
alt
alt
alt
alt
alt
alt
alt

License


All shared libraries found in lib directory are built on top of these products and are available under the terms of the MIT License.

All ruby codes here are available under the terms of the zlib/libpng License ( http://opensource.org/licenses/Zlib ).

Ruby-Imgui : Yet another ImGui wrapper for Ruby
Copyright (c) 2019-2025 vaiorabbit <http://twitter.com/vaiorabbit>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

    1. The origin of this software must not be misrepresented; you must not
    claim that you wrote the original software. If you use this software
    in a product, an acknowledgment in the product documentation would be
    appreciated but is not required.

    2. Altered source versions must be plainly marked as such, and must not be
    misrepresented as being the original software.

    3. This notice may not be removed or altered from any source
    distribution.

Footnotes

  1. See libc folder