mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 10:35:43 -05:00
imgui: Added handling middle mouse button.
This commit is contained in:
parent
06624bb7c2
commit
4018a4b690
13 changed files with 37 additions and 24 deletions
|
@ -300,6 +300,7 @@ class HDR : public entry::AppI
|
|||
, m_mouseState.m_my
|
||||
, (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, m_mouseState.m_mz
|
||||
, m_width
|
||||
, m_height
|
||||
|
|
|
@ -132,6 +132,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, width
|
||||
, height
|
||||
|
|
|
@ -119,6 +119,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, width
|
||||
, height
|
||||
|
|
|
@ -944,6 +944,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, viewState.m_width
|
||||
, viewState.m_height
|
||||
|
|
|
@ -2131,6 +2131,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, viewState.m_width
|
||||
, viewState.m_height
|
||||
|
|
|
@ -1973,6 +1973,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, viewState.m_width
|
||||
, viewState.m_height
|
||||
|
|
|
@ -211,6 +211,7 @@ class DrawStress : public entry::AppI
|
|||
, m_mouseState.m_my
|
||||
, (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, m_mouseState.m_mz
|
||||
, m_width
|
||||
, m_height
|
||||
|
|
|
@ -311,6 +311,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, width
|
||||
, height
|
||||
|
|
|
@ -244,6 +244,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, width
|
||||
, height
|
||||
|
|
|
@ -454,6 +454,7 @@ class Deferred : public entry::AppI
|
|||
, m_mouseState.m_my
|
||||
, (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, m_mouseState.m_mz
|
||||
, m_width
|
||||
, m_height
|
||||
|
|
|
@ -221,6 +221,7 @@ int _main_(int /*_argc*/, char** /*_argv*/)
|
|||
, mouseState.m_my
|
||||
, (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
|
||||
| (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
|
||||
, mouseState.m_mz
|
||||
, width
|
||||
, height
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#define IMGUI_MBUT_LEFT 0x01
|
||||
#define IMGUI_MBUT_RIGHT 0x02
|
||||
#define IMGUI_MBUT_MIDDLE 0x04
|
||||
|
||||
/// For custom values, define these macros before including imgui.h
|
||||
|
||||
|
|
|
@ -235,6 +235,7 @@ struct OcornutImguiContext
|
|||
io.MousePos = ImVec2( (float)_mx, (float)_my);
|
||||
io.MouseDown[0] = 0 != (_button & IMGUI_MBUT_LEFT);
|
||||
io.MouseDown[1] = 0 != (_button & IMGUI_MBUT_RIGHT);
|
||||
io.MouseDown[2] = 0 != (_button & IMGUI_MBUT_MIDDLE);
|
||||
io.MouseWheel = (float)(_scroll - m_lastScroll);
|
||||
m_lastScroll = _scroll;
|
||||
|
||||
|
|
Loading…
Reference in a new issue