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
704f5322
Commit
704f5322
authored
Jul 01, 2019
by
chili
Browse files
toggling cursor
parent
8cf923ec
Changes
2
Show whitespace changes
Inline
Side-by-side
hw3d/App.cpp
View file @
704f5322
...
...
@@ -16,7 +16,6 @@ App::App()
light
(
wnd
.
Gfx
()
)
{
wnd
.
Gfx
().
SetProjection
(
dx
::
XMMatrixPerspectiveLH
(
1.0
f
,
9.0
f
/
16.0
f
,
0.5
f
,
40.0
f
)
);
wnd
.
DisableCursor
();
}
void
App
::
DoFrame
()
...
...
@@ -29,6 +28,23 @@ void App::DoFrame()
nano
.
Draw
(
wnd
.
Gfx
()
);
light
.
Draw
(
wnd
.
Gfx
()
);
while
(
const
auto
e
=
wnd
.
kbd
.
ReadKey
()
)
{
if
(
e
->
IsPress
()
&&
e
->
GetCode
()
==
VK_INSERT
)
{
if
(
cursorEnabled
)
{
wnd
.
DisableCursor
();
cursorEnabled
=
false
;
}
else
{
wnd
.
EnableCursor
();
cursorEnabled
=
true
;
}
}
}
// imgui windows
cam
.
SpawnControlWindow
();
light
.
SpawnControlWindow
();
...
...
@@ -59,6 +75,7 @@ void App::ShowRawInputWindow()
if
(
ImGui
::
Begin
(
"Raw Input"
)
)
{
ImGui
::
Text
(
"Tally: (%d,%d)"
,
x
,
y
);
ImGui
::
Text
(
"Cursor: %s"
,
cursorEnabled
?
"enabled"
:
"disabled"
);
}
ImGui
::
End
();
}
...
...
hw3d/App.h
View file @
704f5322
...
...
@@ -19,6 +19,7 @@ private:
void
ShowImguiDemoWindow
();
void
ShowRawInputWindow
();
private:
bool
cursorEnabled
=
true
;
int
x
=
0
,
y
=
0
;
ImguiManager
imgui
;
Window
wnd
;
...
...
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