Code: Select all
while (device->run())
{
tempReceiver->endEventProcess();
mDriver->beginScene(true, true, video::SColor(255, 255, 0, 0));
mGuiEnv->drawAll();
if (tempReceiver->isGuiUsed(GUI_ID_QUIT_BUTTON))
return -1;
else if (tempReceiver->isGuiUsed(GUI_ID_NEW_GAME_BUTTON))
{
mGuiEnv->clear();
return (Screens::GAME);
}
else if (tempReceiver->isGuiUsed(GUI_ID_NEW_WINDOW_BUTTON))
{
mDriver->draw2DRectangle(SColor(100, 0, 0, 0), rect<s32>(0, 0, 640, 480), 0); // << NOT DRAWING
IGUIWindow* window = mGuiEnv->addWindow(
rect<s32>(100 , 100 , 300 , 200 ),
true, // modal?
L"Test window");
}
mDriver->endScene();
tempReceiver->startEventProcess();
}
Code: Select all
while (device->run())
{
tempReceiver->endEventProcess();
mDriver->beginScene(true, true, video::SColor(255, 255, 0, 0));
mGuiEnv->drawAll();
mDriver->draw2DRectangle(SColor(100, 0, 0, 0), rect<s32>(0, 0, 640, 480), 0); // << DRAWING
if (tempReceiver->isGuiUsed(GUI_ID_QUIT_BUTTON))
return -1;
else if (tempReceiver->isGuiUsed(GUI_ID_NEW_GAME_BUTTON))
{
mGuiEnv->clear();
return (Screens::GAME);
}
else if (tempReceiver->isGuiUsed(GUI_ID_NEW_WINDOW_BUTTON))
{
IGUIWindow* window = mGuiEnv->addWindow(
rect<s32>(100 , 100 , 300 , 200 ),
true, // modal?
L"Test window");
}
mDriver->endScene();
tempReceiver->startEventProcess();
}
What have I done wrong?