
Is there any way to make this work without changing the engine? Or is there something I'm missing?

Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
#ifdef _MSC_VER
#pragma comment(lib, "Irrlicht.lib")
#endif
int main()
{
video::E_DRIVER_TYPE driverType = video::EDT_OPENGL;
IrrlichtDevice * device = createDevice(driverType, core::dimension2d<u32>(640, 480));
if (device == 0)
return 1; // could not create selected driver.
video::IVideoDriver* driver = device->getVideoDriver();
IGUIEnvironment* env = device->getGUIEnvironment();
IGUIComboBox * combo = env->addComboBox(core::rect<s32>(10,100, 200, 130));
for ( int i=0; i<50; ++i )
{
irr::core::stringw foo(i);
foo += L". item";
combo->addItem(foo.c_str());
}
gui::IGUISkin* skin = env->getSkin();
gui::IGUIFont* oldFont = skin->getFont();
oldFont->grab();
gui::IGUIFont* fontBig = env->getFont("../../media/bigfont.png");
fontBig->grab();
u32 oldTime = device->getTimer ()->getTime();
while(device->run() && driver)
{
if (device->isWindowActive())
{
u32 currentTime = device->getTimer ()->getTime();
if ( currentTime-oldTime > 5000 )
{
oldTime = currentTime;
if ( skin->getFont() == oldFont )
skin->setFont(fontBig);
else
skin->setFont(oldFont);
}
driver->beginScene(true, true, SColor(0,200,200,200));
env->drawAll();
driver->endScene();
}
}
device->drop();
return 0;
}