imgui-bindings 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +13 -0
- data/LICENSE.txt +1 -1
- data/README.md +12 -8
- data/lib/imgui.dll +0 -0
- data/lib/imgui.dylib +0 -0
- data/lib/imgui.rb +1534 -2343
- data/lib/imgui_impl_glfw.rb +4 -4
- data/lib/imgui_impl_raylib.rb +4 -10
- data/lib/imgui_impl_sdl2.rb +4 -4
- data/lib/imnodes.dll +0 -0
- data/lib/imnodes.dylib +0 -0
- metadata +3 -3
data/lib/imgui_impl_glfw.rb
CHANGED
@@ -173,10 +173,10 @@ module ImGui
|
|
173
173
|
|
174
174
|
def self.ImGui_ImplGlfw_UpdateKeyModifiers(mods)
|
175
175
|
io = ImGuiIO.new(ImGui::GetIO())
|
176
|
-
io.AddKeyEvent(
|
177
|
-
io.AddKeyEvent(
|
178
|
-
io.AddKeyEvent(
|
179
|
-
io.AddKeyEvent(
|
176
|
+
io.AddKeyEvent(ImGuiMod_Ctrl, (mods & GLFW::MOD_CONTROL) != 0)
|
177
|
+
io.AddKeyEvent(ImGuiMod_Shift, (mods & GLFW::MOD_SHIFT) != 0)
|
178
|
+
io.AddKeyEvent(ImGuiMod_Alt, (mods & GLFW::MOD_ALT) != 0)
|
179
|
+
io.AddKeyEvent(ImGuiMod_Super, (mods & GLFW::MOD_SUPER) != 0)
|
180
180
|
end
|
181
181
|
|
182
182
|
@@ImplGlfw_MouseButtonCallback = GLFW::create_callback(:GLFWmousebuttonfun) do |window, button, action, mods|
|
data/lib/imgui_impl_raylib.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'ffi'
|
2
2
|
require 'raylib'
|
3
|
-
require 'opengl'
|
4
3
|
|
5
4
|
require_relative 'imgui'
|
6
5
|
|
@@ -260,10 +259,10 @@ module ImGui
|
|
260
259
|
# [INTERNAL]
|
261
260
|
def self.ImGui_ImplRaylib_UpdateKeyModifiers()
|
262
261
|
io = ImGuiIO.new(ImGui::GetIO())
|
263
|
-
io.AddKeyEvent(
|
264
|
-
io.AddKeyEvent(
|
265
|
-
io.AddKeyEvent(
|
266
|
-
io.AddKeyEvent(
|
262
|
+
io.AddKeyEvent(ImGuiMod_Ctrl, Raylib.IsKeyDown(Raylib::KEY_RIGHT_CONTROL) || Raylib.IsKeyDown(Raylib::KEY_LEFT_CONTROL))
|
263
|
+
io.AddKeyEvent(ImGuiMod_Shift, Raylib.IsKeyDown(Raylib::KEY_RIGHT_SHIFT) || Raylib.IsKeyDown(Raylib::KEY_LEFT_SHIFT))
|
264
|
+
io.AddKeyEvent(ImGuiMod_Alt, Raylib.IsKeyDown(Raylib::KEY_RIGHT_ALT) || Raylib.IsKeyDown(Raylib::KEY_LEFT_ALT))
|
265
|
+
io.AddKeyEvent(ImGuiMod_Super, Raylib.IsKeyDown(Raylib::KEY_RIGHT_SUPER) || Raylib.IsKeyDown(Raylib::KEY_LEFT_SUPER))
|
267
266
|
end
|
268
267
|
|
269
268
|
def self.ImplRaylib_ProcessKeyboard()
|
@@ -379,11 +378,6 @@ module ImGui
|
|
379
378
|
ImplRaylib_UpdateMouseCursor()
|
380
379
|
|
381
380
|
# [TODO] update gamepads
|
382
|
-
|
383
|
-
# [NOTE] rlgl does not provide glBlendFuncSeparate wrapper. So we manually set states for ImGui here.
|
384
|
-
# Ref.: https://github.com/vaiorabbit/ruby-imgui/blob/05e94e6bf1969d3abf12598fef831219dca90247/lib/imgui_impl_opengl3.rb#L227-L234
|
385
|
-
# [TODO] Hide raw OpenGL operation
|
386
|
-
GL.BlendFuncSeparate(GL::SRC_ALPHA, GL::ONE_MINUS_SRC_ALPHA, GL::ONE, GL::ONE_MINUS_SRC_ALPHA)
|
387
381
|
end
|
388
382
|
|
389
383
|
# [INTERNAL]
|
data/lib/imgui_impl_sdl2.rb
CHANGED
@@ -170,10 +170,10 @@ module ImGui
|
|
170
170
|
# [INTERNAL]
|
171
171
|
def self.ImGui_ImplSDL2_UpdateKeyModifiers(sdl_key_mods)
|
172
172
|
io = ImGuiIO.new(ImGui::GetIO())
|
173
|
-
io.AddKeyEvent(
|
174
|
-
io.AddKeyEvent(
|
175
|
-
io.AddKeyEvent(
|
176
|
-
io.AddKeyEvent(
|
173
|
+
io.AddKeyEvent(ImGuiMod_Ctrl, (sdl_key_mods & SDL::KMOD_CTRL) != 0)
|
174
|
+
io.AddKeyEvent(ImGuiMod_Shift, (sdl_key_mods & SDL::KMOD_SHIFT) != 0)
|
175
|
+
io.AddKeyEvent(ImGuiMod_Alt, (sdl_key_mods & SDL::KMOD_ALT) != 0)
|
176
|
+
io.AddKeyEvent(ImGuiMod_Super, (sdl_key_mods & SDL::KMOD_GUI) != 0)
|
177
177
|
end
|
178
178
|
|
179
179
|
# You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
data/lib/imnodes.dll
CHANGED
Binary file
|
data/lib/imnodes.dylib
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: imgui-bindings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -82,7 +82,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '0'
|
84
84
|
requirements: []
|
85
|
-
rubygems_version: 3.
|
85
|
+
rubygems_version: 3.4.1
|
86
86
|
signing_key:
|
87
87
|
specification_version: 4
|
88
88
|
summary: Bindings for Dear ImGui
|