Skip to content

dinau/igruby_examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IgRuby Examples


Ruby language + Dear ImGui + Additional libraries and examples project

See ruby-imgui-dev

Prerequisites


✅ Windows11 or later

✅ 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 then extract zip file.

  2. Execute bundler command,

    $ 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

  3. Execute one of the example script,

    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 / CImGui-Toggle

glfw_opengl3_imtoggle.rb

alt

ImDrawList party

Reference to ImDrawList coding party - deadline Nov 30, 2020! #3606

imDrawListParty.rb

alt

ImGui-Knobs / CImGui-Knobs

ImGui-Knobs / CImGui-Knobs

glfw_opengl3_imknobs.rb

alt

ImSpinner

ImSpinner

glfw_opengl3_imspinner.rb

Amazing !

alt

ImGuizmo / CImGuizmo

ImGuizmo / CImGuizmo

glfw_opengl3_imguizmo.rb

alt

ImGuiColorTextEdit / cimCTE

ImGuiColorTextEdit / cimCTE

glfw_opengl3_imcolortextedit.rb

alt

ImNodes / CImNodes

ImNodes / CImNodes

glfw_opengl3_imnodes.rb

alt

ImGuiFileDialog

ImGuiFileDialog

glfw_opengl3_imguifiledialog.rb

alt

Iconfonts viewer

glfw_opengl3_iconfont_viewer.rb

alt

Image loading

glfw_opengl3.rb

alt

Showing CJK fonts

glfw_opengl3_jp.rb

alt

For Linux x86_64


  1. Install tools

    $ 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
  2. Download files,

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

    Folder structure,

    my_dev_folder
     |--- igruby_examples
     `--- ruby-imgui-dev
  3. Generate imgui.so

    $ cd ruby-imgui-dev/imgui_dll
    $ make

    imgui.so file is generated in ruby-imgui-dev/lib

  4. Install bundler

    $ sudo apt install ruby-dev gcc
    $ gem install --user-install bundler
  5. Set environment variable,

    export GEM_HOME =~/.local/share/gem/ruby/3.3.0/bin

    Part of the 3.3.0 depends on your system.

  6. Execute bundle install

    $ 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.
  7. Execute a example

    $ 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