https://github.com/dinau/igruby_examples
Some examples for ruby-imgui
https://github.com/dinau/igruby_examples
aibika awesome cimgui dear-imgui examples executable gui imgui imguifiledialog imguizmo imknobs imnodes implot implot3d imspinner imtoggle ruby stb
Last synced: 16 days ago
JSON representation
Some examples for ruby-imgui
- Host: GitHub
- URL: https://github.com/dinau/igruby_examples
- Owner: dinau
- License: mit
- Created: 2025-02-01T10:02:01.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-04T10:45:46.000Z (9 months ago)
- Last Synced: 2025-10-04T12:26:50.751Z (9 months ago)
- Topics: aibika, awesome, cimgui, dear-imgui, examples, executable, gui, imgui, imguifiledialog, imguizmo, imknobs, imnodes, implot, implot3d, imspinner, imtoggle, ruby, stb
- Language: Ruby
- Homepage:
- Size: 20.5 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
- [IgRuby Examples](#igruby-examples)
- [Prerequisites](#prerequisites)
- [Donwload and running examples on Windows OS](#donwload-and-running-examples-on-windows-os)
- [Snapshots](#snapshots)
- [ImGui-Toggle / CImGui-Toggle](#imgui-toggle--cimgui-toggle)
- [ImDrawList party](#imdrawlist-party)
- [ImGui-Knobs / CImGui-Knobs](#imgui-knobs--cimgui-knobs)
- [ImSpinner](#imspinner)
- [ImGuizmo / CImGuizmo](#imguizmo--cimguizmo)
- [ImGuiColorTextEdit / cimCTE](#imguicolortextedit--cimcte)
- [ImNodes / CImNodes](#imnodes--cimnodes)
- [ImGuiFileDialog](#imguifiledialog)
- [Iconfonts viewer](#iconfonts-viewer)
- [Image loading](#image-loading)
- [Showing CJK fonts](#showing-cjk-fonts)
- [For Linux x86_64](#for-linux-x86_64)
### IgRuby Examples
---
Ruby language + [Dear ImGui](https://github.com/ocornut/imgui) + Additional libraries and examples project
See [ruby-imgui-dev](https://github.com/dinau/ruby-imgui-dev)
#### Prerequisites
---
✅ Windows11 or later
- Install [RubyInstaller + **Devkit** ](https://rubyinstaller.org/downloads/) 3.4.7 or later
(You must install Devkit)
✅ Linux OS x86_64
- Debian13 Trixie, Ubuntu families and Windows WSL2
#### Donwload and running examples on Windows OS
---
1. Download `igruby_examples-1.9x.y-bdn.zip` from [Release page](https://github.com/dinau/igruby_examples/releases) then extract zip file.
1. Execute bundler command,
```sh
$ cd igruby_examples-1.91.8-bd2/igruby_examples
$ bundle install
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Bundle complete! 6 Gemfile dependencies, 9 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
```
Note: Only supported under bundler enviroment at this moment
1. Execute one of the example script,
```sh
cd glfw_opengl3
r.bat # Or double click glfw_opengl3.rbw in Windows explorer
# Ignore many warnings emmited in console window
```
#### Snapshots
---
##### ImGui-Toggle / CImGui-Toggle
---
[ImGui-Toggle](https://github.com/cmdwtf/imgui_toggle) / [CImGui-Toggle](https://github.com/dinau/cimgui_toggle)
[glfw_opengl3_imtoggle.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_imtoggle/glfw_opengl3_imtoggle.rb)

##### ImDrawList party
---
Reference to [ImDrawList coding party - deadline Nov 30, 2020! #3606](https://github.com/ocornut/imgui/issues/3606)
[imDrawListParty.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_imdrawlistparty/imDrawListParty.rb)

##### ImGui-Knobs / CImGui-Knobs
---
[ImGui-Knobs](https://github.com/altschuler/imgui-knobs) / [CImGui-Knobs](https://github.com/dinau/cimgui-knobs)
[glfw_opengl3_imknobs.rb](glfw_opengl3_imknobs/glfw_opengl3_imknobs.rb)

##### ImSpinner
---
[ImSpinner](https://github.com/dalerank/imspinner)
[glfw_opengl3_imspinner.rb](glfw_opengl3_imspinner/glfw_opengl3_imspinner.rb)
Amazing !

##### ImGuizmo / CImGuizmo
---
[ImGuizmo](https://github.com/CedricGuillemet/ImGuizmo) / [CImGuizmo](https://github.com/cimgui/cimguizmo)
[glfw_opengl3_imguizmo.rb](glfw_opengl3_imguizmo/glfw_opengl3_imguizmo.rb)

##### ImGuiColorTextEdit / cimCTE
---
[ImGuiColorTextEdit](https://github.com/santaclose/ImGuiColorTextEdit) / [cimCTE](https://github.com/cimgui/cimCTE)
[glfw_opengl3_imcolortextedit.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_imcolortextedit/glfw_opengl3_imcolortextedit.rb)

##### ImNodes / CImNodes
---
[ImNodes](https://github.com/Nelarius/imnodes) / [CImNodes](https://github.com/cimgui/cimnodes)
[glfw_opengl3_imnodes.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_imnodes/glfw_opengl3_imnodes.rb)

##### ImGuiFileDialog
---
[ImGuiFileDialog](https://github.com/aiekick/ImGuiFileDialog)
[glfw_opengl3_imguifiledialog.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_imguifiledialog/glfw_opengl3_imguifiledialog.rb)

##### Iconfonts viewer
---
[glfw_opengl3_iconfont_viewer.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_iconfont_viewer/glfw_opengl3_iconfont_viewer.rb)

##### Image loading
---
[glfw_opengl3.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3/glfw_opengl3.rb)

##### Showing CJK fonts
---
[glfw_opengl3_jp.rb](https://github.com/dinau/igruby_examples/blob/main/glfw_opengl3_jp/glfw_opengl3_jp.rb)

#### For Linux x86_64
---
1. Install tools
```sh
$ 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
```
1. Download files,
```sh
$ pwd
my_dev_folder
$ git clone --recursive https://github.com/dinau/ruby-imgui-dev
$ git clone https://github.com/dinau/igruby_examples
```
Folder structure,
```txt
my_dev_folder
|--- igruby_examples
`--- ruby-imgui-dev
```
1. Generate imgui.so
```sh
$ cd ruby-imgui-dev/imgui_dll
$ make
```
`imgui.so` file is generated in `ruby-imgui-dev/lib`
1. Install bundler
```sh
$ sudo apt install ruby-dev gcc
$ gem install --user-install bundler
```
1. Set environment variable,
```sh
export GEM_HOME =~/.local/share/gem/ruby/3.3.0/bin
```
Part of the `3.3.0` depends on your system.
1. Execute `bundle install`
```sh
$ pwd
igruby_examples
$ bundle install
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Installing fiddle 1.1.8 with native extensions
Fetching opengl-bindings2 2.0.4
Installing opengl-bindings2 2.0.4
Bundle complete! 6 Gemfile dependencies, 9 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
```
1. Execute a example
```sh
$ cd glfw_opengl3
$ sh r.sh
```
or
`$ chmod +x glfw_opengl3.rbw`
then double click `glfw_opengl3.rbw` in your file explorer
or
`$ bundle exec ruby glfw_opengl3.rb` on your console