Page 1 of 1

Clearing the VRAM

Posted: June 3rd, 2013, 6:53 pm
by t0rxe
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.

Code: Select all

void clearVRAM()
{
     RECT rectTL;
     setRECT(&rectTL, 0, 0, 1024, 512);
     ClearImage2(&rectTL, 0, 0, 0);
     DrawSync(0);
     printf("VRAM cleared!\n");
}

Re: Clearing the VRAM

Posted: June 5th, 2013, 10:59 pm
by DEBRO
Nice...thanks for the post.