imgui-bindings 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -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(ImGuiKey_ModCtrl, (mods & GLFW::MOD_CONTROL) != 0)
177
- io.AddKeyEvent(ImGuiKey_ModShift, (mods & GLFW::MOD_SHIFT) != 0)
178
- io.AddKeyEvent(ImGuiKey_ModAlt, (mods & GLFW::MOD_ALT) != 0)
179
- io.AddKeyEvent(ImGuiKey_ModSuper, (mods & GLFW::MOD_SUPER) != 0)
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|
@@ -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(ImGuiKey_ModCtrl, Raylib.IsKeyDown(Raylib::KEY_RIGHT_CONTROL) || Raylib.IsKeyDown(Raylib::KEY_LEFT_CONTROL))
264
- io.AddKeyEvent(ImGuiKey_ModShift, Raylib.IsKeyDown(Raylib::KEY_RIGHT_SHIFT) || Raylib.IsKeyDown(Raylib::KEY_LEFT_SHIFT))
265
- io.AddKeyEvent(ImGuiKey_ModAlt, Raylib.IsKeyDown(Raylib::KEY_RIGHT_ALT) || Raylib.IsKeyDown(Raylib::KEY_LEFT_ALT))
266
- io.AddKeyEvent(ImGuiKey_ModSuper, Raylib.IsKeyDown(Raylib::KEY_RIGHT_SUPER) || Raylib.IsKeyDown(Raylib::KEY_LEFT_SUPER))
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]
@@ -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(ImGuiKey_ModCtrl, (sdl_key_mods & SDL::KMOD_CTRL) != 0)
174
- io.AddKeyEvent(ImGuiKey_ModShift, (sdl_key_mods & SDL::KMOD_SHIFT) != 0)
175
- io.AddKeyEvent(ImGuiKey_ModAlt, (sdl_key_mods & SDL::KMOD_ALT) != 0)
176
- io.AddKeyEvent(ImGuiKey_ModSuper, (sdl_key_mods & SDL::KMOD_GUI) != 0)
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.0
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: 2022-08-14 00:00:00.000000000 Z
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.3.4
85
+ rubygems_version: 3.4.1
86
86
  signing_key:
87
87
  specification_version: 4
88
88
  summary: Bindings for Dear ImGui