I need help about button
Posted: Wed Dec 27, 2006 6:03 pm
I have an Idea to modify the tutorial 12 to function and use the button from tutorial 5 to call that function but the trouble is occured.
For easy to think,
When program run tutorial 5 successful the buttons will appear.
Next when I click at button "New Game" the program will call function and draw the terrain (tutorial 12) but the problem is the button still appear
This is code in main() //Tutorial 5
Thank you...
For easy to think,
When program run tutorial 5 successful the buttons will appear.
Next when I click at button "New Game" the program will call function and draw the terrain (tutorial 12) but the problem is the button still appear
This is code in main() //Tutorial 5
And this is code in function// look like Tutorial 12
env->addButton(rect<s32>(300,250,500,290), 0, 102, L"New Game"); // when click this button it will call function
env->addButton(rect<s32>(300,350,500,390), 0, 103, L"Load Game");
env->addButton(rect<s32>(300,450,500,490), 0, 101, L"Exit");
while(device->run() && driver)
if (device->isWindowActive())
{
driver->beginScene(true, true, SColor(0,0,0,0));
env->drawAll();
driver->endScene();
}
device->drop();
return 0;
What should I do to clear the first "env"while(device->run())
if (device->isWindowActive())
{
driver->beginScene(true, true, 0 );
smgr->drawAll();
env->drawAll();
driver->endScene();
// display frames per second in window title
int fps = driver->getFPS();
if (lastFPS != fps)
{
str += driver->getName();
str += "] FPS:";
str += fps;
device->setWindowCaption(str.c_str());
lastFPS = fps;
}
}
device->drop();
Thank you...