Clearing the VRAM
Posted: June 3rd, 2013, 6:53 pm
This function makes a 1024x512px rectangle in the framebuffer (coordinates x0, y0) with the colour black (RGB 0,0,0).
It is very useful to ensure no garbage is seen whilst loading in new images, or you wish to clear the entire framebuffer. It should be called (once) in your video mode setup stage.
It is very useful to ensure no garbage is seen whilst loading in new images, or you wish to clear the entire framebuffer. It should be called (once) in your video mode setup stage.
Code: Select all
void clearVRAM()
{
RECT rectTL;
setRECT(&rectTL, 0, 0, 1024, 512);
ClearImage2(&rectTL, 0, 0, 0);
DrawSync(0);
printf("VRAM cleared!\n");
}