You are not logged in.

#1 2009-04-09 20:16:17

flarup
Member

GRRLIB_Render right before doing IO

Hello again

Progress has been made on my little drawing program smile I have implemented a feature that enables you to save your image to the SD card, and right before the program starts saving the image I would like to display a text on the screen, saying something like "Saving image...". The code looks like this:

GRRLIB_Printf(20, 20, tex_font4, BLACK, 1, "SAVING IMAGE...");
GRRLIB_Render();
// Here SD card IO is performed (fatInitDefault, fopen, fwrite and all that stuff)

My problem is that the "Saving image..." text doesn't always show up before the program starts doing the IO. It maybe shows up 1 out of 3 times. I have tried calling VIDEO_WaitVSync() before doing the IO, but it didn't solve the problem. My code is single-threaded.

My question is: What is the proper way to ensure that the screen is updated after the call to Render()?

Thanks a lot in advance.


Flarup

Offline

 

#2 2009-04-11 10:27:51

linus
Member

Re: GRRLIB_Render right before doing IO

This has been problem for me too. When I try and display "downloading" before calling a function that downloads and save a webpage to sd card. I found if you do render before you write the graphics then again after the ratio is better but still not 100 percent. There must be a way to stop the program until the framebuffer changes.

Offline

 

#3 2009-04-13 15:19:37

flarup
Member

Re: GRRLIB_Render right before doing IO

Thanks a lot for your reply. By drawing the message, followed by Render(), three times in a row the problem seems to be solved wink

Offline

 

Board footer

Powered by FluxBB