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
86cd5dff
Commit
86cd5dff
authored
Dec 23, 2018
by
chili
Browse files
test mouse input system
parent
416d3cdb
Changes
1
Show whitespace changes
Inline
Side-by-side
hw3d/WinMain.cpp
View file @
86cd5dff
...
...
@@ -18,6 +18,7 @@
* along with The Chili Direct3D Engine. If not, see <http://www.gnu.org/licenses/>. *
******************************************************************************************/
#include "Window.h"
#include <sstream>
int
CALLBACK
WinMain
(
...
...
@@ -37,6 +38,18 @@ int CALLBACK WinMain(
// TranslateMessage will post auxilliary WM_CHAR messages from key msgs
TranslateMessage
(
&
msg
);
DispatchMessage
(
&
msg
);
// do app logic (test)
while
(
!
wnd
.
mouse
.
IsEmpty
()
)
{
const
auto
e
=
wnd
.
mouse
.
Read
();
if
(
e
.
GetType
()
==
Mouse
::
Event
::
Type
::
Move
)
{
std
::
ostringstream
oss
;
oss
<<
"Mouse Position: ("
<<
e
.
GetPosX
()
<<
","
<<
e
.
GetPosY
()
<<
")"
;
wnd
.
SetTitle
(
oss
.
str
()
);
}
}
}
// check if GetMessage call itself borked
...
...
Ghost User
@ghost
mentioned in commit
b525461b
·
Mar 22, 2023
mentioned in commit
b525461b
mentioned in commit b525461b522f7b7816c8fec58f60e43534427c35
Toggle commit list
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