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
364bf0ce
Commit
364bf0ce
authored
Feb 03, 2019
by
chili
Browse files
test kbd evt optional
parent
cf87f10a
Changes
1
Hide whitespace changes
Inline
Side-by-side
hw3d/App.cpp
View file @
364bf0ce
...
...
@@ -21,6 +21,23 @@ int App::Go()
void
App
::
DoFrame
()
{
static
std
::
string
title
;
while
(
const
auto
e
=
wnd
.
kbd
.
ReadKey
()
)
{
if
(
e
->
IsPress
()
&&
e
->
GetCode
()
==
VK_BACK
)
{
title
.
clear
();
wnd
.
SetTitle
(
title
);
}
}
while
(
const
auto
c
=
wnd
.
kbd
.
ReadChar
()
)
{
if
(
*
c
!=
0x8
)
// don't print backspace
{
title
+=
*
c
;
wnd
.
SetTitle
(
title
);
}
}
const
float
c
=
sin
(
timer
.
Peek
()
)
/
2.0
f
+
0.5
f
;
wnd
.
Gfx
().
ClearBuffer
(
c
,
c
,
1.0
f
);
wnd
.
Gfx
().
DrawTestTriangle
();
...
...
Ghost User
@ghost
mentioned in commit
27bd983e
·
Mar 22, 2023
mentioned in commit
27bd983e
mentioned in commit 27bd983e7ec0f1d78c4e413cd7eb6760e5650e87
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