Last active
January 31, 2020 13:38
-
-
Save ali1234/a486663698af09c66fa56c8b23c8b85b to your computer and use it in GitHub Desktop.
image retention test. don't run this.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Tearing test | |
#include "32blit.hpp" | |
uint16_t width = 160; | |
uint16_t height = 120; | |
uint32_t prev_buttons = blit::buttons; | |
uint32_t updates = 0; | |
void init(void) { | |
blit::set_screen_mode(blit::lores); | |
} | |
void update(uint32_t time) { | |
updates++; | |
} | |
void render(uint32_t time) { | |
static uint32_t renders = 0; | |
if (blit::buttons) { | |
blit::fb.pen(blit::rgba(127, 127, 127)); | |
blit::fb.clear(); | |
} else { | |
blit::fb.pen(blit::rgba(0, 0, 0)); | |
blit::fb.clear(); | |
if (renders&1) { | |
blit::fb.pen(blit::rgba(255, 255, 255)); | |
blit::fb.rectangle(blit::rect(70, 50, 20, 20)); | |
} | |
} | |
renders++; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment