Fabien Comte Posted March 16, 2018 Report Share Posted March 16, 2018 Hello, How to avoid flicker during console or image update (like a double buffer) ? Thank you. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 16, 2018 Report Share Posted March 16, 2018 Hi, The most common solution is (as you mentioned) double buffer. However, proper double buffering is very hard to implement and also requires hardware support. While µGFX can fully support double buffering (with the multiple displays API) we do also provide you with a more flexible way: Pixmaps. You can simply render your widget into a pixmap and then blit that pixmap to your real display. Pixmaps have certain advantages over real double buffering. The most notable is that you don't need two times the memory for the entire display area - a pixmap can be just a small portion of the screen. Other than that there are other things which vastly improve these sort of things such as anti-tearing-effect flags and so on. But all of that needs to be supported by the hardware. Link to comment Share on other sites More sharing options...
Fabien Comte Posted March 16, 2018 Author Report Share Posted March 16, 2018 Hi, I'm not memory limited, is there any exemple how to "pixmap hack" a widget ? Else, where i have to code that ? Thank you Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 16, 2018 Report Share Posted March 16, 2018 There's no hacking involved. You just need to change the GDisplay* pointer. We did the same thing for the µGFX-Studio. Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 16, 2018 Report Share Posted March 16, 2018 This is the relevant code taken from the µGFX-Studio v0.22.4: void UGfxWindow::setDisplay(GDisplay* g) { if (!_ghandle) { return; } // Nullptr means default/standard display if (!g) { g = GDISP; } gwinHide(_ghandle); _ghandle->display = g; gwinShow(_ghandle); } _handle is the GHandle. Link to comment Share on other sites More sharing options...
Fabien Comte Posted March 16, 2018 Author Report Share Posted March 16, 2018 I will try that in few days. Thank you for your help. Link to comment Share on other sites More sharing options...
Fabien Comte Posted March 20, 2018 Author Report Share Posted March 20, 2018 Hello, I tried to take a look to your proposal but i not found were you are speaking about. Another question on this theme please: When i change page from one with a black background to another one with a black background, i can see a very quick grey or white (maybe 1 frame). There is probably a fill function before background draw. Do you confirm ? If yes, how to disable it please ? Thank you. Link to comment Share on other sites More sharing options...
Fabien Comte Posted March 20, 2018 Author Report Share Posted March 20, 2018 On 16/03/2018 at 09:47, Joel Bodenmann said: Hi, The most common solution is (as you mentioned) double buffer. However, proper double buffering is very hard to implement and also requires hardware support. While µGFX can fully support double buffering (with the multiple displays API) we do also provide you with a more flexible way: Pixmaps. You can simply render your widget into a pixmap and then blit that pixmap to your real display. Pixmaps have certain advantages over real double buffering. The most notable is that you don't need two times the memory for the entire display area - a pixmap can be just a small portion of the screen. Other than that there are other things which vastly improve these sort of things such as anti-tearing-effect flags and so on. But all of that needs to be supported by the hardware. Do you have any exemple of multiple display API ? Link to comment Share on other sites More sharing options...
Joel Bodenmann Posted March 20, 2018 Report Share Posted March 20, 2018 2 minutes ago, Fabien Comte said: I tried to take a look to your proposal but i not found were you are speaking about. https://wiki.ugfx.io/index.php/Pixmaps 1 minute ago, Fabien Comte said: Do you have any exemple of multiple display API ? https://wiki.ugfx.io/index.php/Multiple_displays 6 minutes ago, Fabien Comte said: When i change page from one with a black background to another one with a black background, i can see a very quick grey or white (maybe 1 frame). There is probably a fill function before background draw. Do you confirm ? If yes, how to disable it please ? Yes. that is correct. It cannot be disabled. It's a built-in feature. This allows for a much smaller and faster window manager. You cannot hide a background (container) without overwriting the area because you can't delete something from the display - you need to overwrite it. You can use doublebuffering as explained in my previous post to prevent things like this (there are many other additional things such as TE integration and so on). Link to comment Share on other sites More sharing options...
Fabien Comte Posted March 20, 2018 Author Report Share Posted March 20, 2018 Thank you for your quick answer. I am sorry but i don't know how to use your last post to avoid my issue... Link to comment Share on other sites More sharing options...
Fabien Comte Posted March 20, 2018 Author Report Share Posted March 20, 2018 7 minutes ago, Joel Bodenmann said: Yes. that is correct. It cannot be disabled. It's a built-in feature. This allows for a much smaller and faster window manager. You cannot hide a background (container) without overwriting the area because you can't delete something from the display - you need to overwrite it. You can use doublebuffering as explained in my previous post to prevent things like this (there are many other additional things such as TE integration and so on). But if i do a full redraw of the screen with my black background, i want to avoid this white flash. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now