Skip to content

Commit

Permalink
examples/devpmtest: wire-up up/down arrows
Browse files Browse the repository at this point in the history
  • Loading branch information
vs49688 committed May 11, 2024
1 parent 4049e20 commit 5534fe2
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/devpmtest/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,13 @@ int main(int argc, char **argv)
case SDLK_F5:
want_screenshot = 1;
break;
case SDLK_UP:
if(test_index == 0)
test_index = BR_ASIZE(tests) - 1;
else
test_index -= 1;
break;
case SDLK_DOWN:
case SDLK_SPACE:
test_index = (test_index + 1) % BR_ASIZE(tests);
break;
Expand Down Expand Up @@ -1071,9 +1078,10 @@ int main(int argc, char **argv)

static const char *usage_lines[] = {
"Usage:",
" Q = Quit",
" Space = Next Test",
" F5 = Screenshot (to devpmtest.png)",
" Q = Quit",
" Up, Space = Next Test",
" Down = Prev Test",
" F5 = Screenshot (to devpmtest.png)",
};

BrPixelmapTextF(colour_buffer, base_x, base_y, col, BrFontProp7x9, "last frame delta (msec): %f", dt * 1000);
Expand Down

0 comments on commit 5534fe2

Please sign in to comment.