Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Clark Lin
hw3d
Commits
12914fe9
Commit
12914fe9
authored
Jul 01, 2019
by
chili
Browse files
disabling of imgui mouse input
parent
2f5bddb5
Changes
2
Show whitespace changes
Inline
Side-by-side
hw3d/Window.cpp
View file @
12914fe9
...
...
@@ -123,12 +123,14 @@ void Window::EnableCursor()
{
cursorEnabled
=
true
;
ShowCursor
();
EnableImGuiMouse
();
}
void
Window
::
DisableCursor
()
{
cursorEnabled
=
false
;
HideCursor
();
DisableImGuiMouse
();
}
std
::
optional
<
int
>
Window
::
ProcessMessages
()
noexcept
...
...
@@ -172,6 +174,16 @@ void Window::ShowCursor()
while
(
::
ShowCursor
(
TRUE
)
<
0
);
}
void
Window
::
EnableImGuiMouse
()
{
ImGui
::
GetIO
().
ConfigFlags
&=
~
ImGuiConfigFlags_NoMouse
;
}
void
Window
::
DisableImGuiMouse
()
{
ImGui
::
GetIO
().
ConfigFlags
|=
ImGuiConfigFlags_NoMouse
;
}
LRESULT
CALLBACK
Window
::
HandleMsgSetup
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
noexcept
{
// use create parameter passed in from CreateWindow() to store window class pointer at WinAPI side
...
...
hw3d/Window.h
View file @
12914fe9
...
...
@@ -82,6 +82,8 @@ public:
private:
void
HideCursor
();
void
ShowCursor
();
void
EnableImGuiMouse
();
void
DisableImGuiMouse
();
static
LRESULT
CALLBACK
HandleMsgSetup
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
noexcept
;
static
LRESULT
CALLBACK
HandleMsgThunk
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
noexcept
;
LRESULT
HandleMsg
(
HWND
hWnd
,
UINT
msg
,
WPARAM
wParam
,
LPARAM
lParam
)
noexcept
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment