dynamic_cast of IGUIElement seg faults
Posted: Sun May 24, 2015 6:01 am
It seems irrlicht is configured to compile with no RTTI - Is there a reason why I shouldn't enable it?
Maybe I should modify how I go about things?
I'm casting to get the gui values after a button was clicked, e.g:
Is there a better way, or should I just recompile the library with RTTI on?
Maybe I should modify how I go about things?
I'm casting to get the gui values after a button was clicked, e.g:
Code: Select all
unsigned int CMazeGameMenu::getChosenNumOfAIPlayers()
{
float numOfAI = dynamic_cast<irr::gui::IGUISpinBox *>(
_guiEnv->getRootGUIElement()->getElementFromId(MenuElement::MazeNumOfAI))->getValue();
return static_cast<unsigned int>(round(numOfAI));
}