I am trying to fade my background onto the screen over a duration of 2 seconds. The code I'm using (below) just makes the bitmap instantly appear fully visible, but I fail to see why. Hopefully you guys will know what my problem is.
bool MenuCreated;
int MenuFadeStart,fade;
void Menu::RenderMenu(void)
{
if(MenuCreated == false)
{
dbLoadBitmap("menu.bmp",0);
dbFadeBitmap(0,0);
MenuFadeStart = dbTimer();
MenuCreated = true;
}
fade = (100/2000)*(dbTimer()-MenuFadeStart);
dbFadeBitmap(0,fade);
dbText(1,1,dbChr(fade));
}