Replies: 1 comment 3 replies
-
Don't you need to call createFullScreen(); twice? Write it once for the front buffer and then the back? The back buffer is its own completely blank canvas. You'll get flicker because every second buffer flip has no static stuff drawn |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
TL;DR: Is there a way to flipDMABuffer without actually displaying the other buffer?
My display project includes information that scrolls vertically (headers stay put, bottom lines scroll up) and horizontally (text scrolls across the screen in a single line.) They both have static text and scrolling text on the same screen.
I initially used a single buffer and did the horizontal text by blanking a horizontal rectangle and rewriting the text. Works great, no flicker.
When I added vertical scrolling I switched to double-buffering to prevent flickering of the non-scrolling text. However that introduced flickering of the horizontal scroll screens because I was not redrawing the entire screen, just the scrolling line. It is complex/expensive to redraw the static screen elements for each scrolling frame.
Psuedo code:
// Build the base screen
clearScreen();
createFullScreen(); // Assume this is an expensive/long function.
flipDMABuffer();
clearScreen(); // Clear the background screen in prep for the loop
// Scroll the single line text (this works great with single buffer but has a slight flicker when you show the blank screen for a millisec)
while (scrolling)
flipDMABuffer(); // To make the full display active
drawRectangle(scrollArea, BLACK); // Blank the scroll area
writeScrollText( x++, y, text);
flipDMABuffer(); // Return the full display with the shifted text
What I really need is a "flipDMABufferNoDisplay()" function (or a flag to flipDMABuffer) so I can make the other buffer active without actually sending the other screen to the display. I wrote this function in the library and it works great, but I'm wondering if there's a better way.
Here's what works for me:
Is there a better way to accomplish what I'm doing here? Or is this a reasonable enhancement?
Beta Was this translation helpful? Give feedback.
All reactions