Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

reset drawing state each time around the game loop #66

Merged
merged 1 commit into from
Nov 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions libraries/picosystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,15 @@ int main() {
while(true) {
uint32_t start_tick_us = time_us();

// reset drawing state except font and spritesheet
pen();
alpha();
clip();
blend();
target();
camera();
cursor();

// store previous io state and get new io state
_lio = _io;
_io = _gpio_get();
Expand Down
4 changes: 2 additions & 2 deletions libraries/picosystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ namespace picosystem {
// primitives
void clear();
void pixel(int32_t x, int32_t y);
void hline(int32_t x, int32_t y, int32_t c);
void vline(int32_t x, int32_t y, int32_t c);
void hline(int32_t x, int32_t y, int32_t l);
void vline(int32_t x, int32_t y, int32_t l);
void poly(const int32_t *p, uint32_t l);
void poly(const std::initializer_list<int32_t> &pts);
void fpoly(const int32_t *p, uint32_t l);
Expand Down