Hi I'm having some trouble implementing a menu button, here is my code..
void gamemenu()
{
Background* menu = new Background;
menu->menu();
MenuObject* play = new MenuObject;
play->playbutton();
MenuObject* exit = new MenuObject;
exit->exitbutton();
bool click = 0;
while(click == 0)
{
float mX = dbMouseX(); //Use it inside the loop so its updated
float mY = dbMouseY(); //Use it inside the loop so its updated
if(mX >= 400 && mX <= 600 && mY >= 450 && mX <= 550 && dbMouseClick())
{
delete play;
play = NULL;
dbSync();
}
}
}
The problem is, when the compiler enters the gamemenu() function the screen just goes blank and freezes up.
Thanks in advance.
EDIT
I've just solved my problem, it turns out I needed a dbSync() just after entering the while loop.