I require case-sensitive filenames, and it appears that this addFileOpenDialog function only deals with lower-case filename strings.
It lists all the files in lower case, and also when I retrieve the selected name using getFileName the returned string appears to be similarly lowercased.
I tested this with MSVC on XP using the code from the tutorials:
(Irrlicht 1.7.1, not SVN)
Code: Select all
#include <irrlicht.h>
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
IGUIEnvironment* guienv = 0;
IGUIStaticText *guiTest = 0;
class MyEventReceiver : public IEventReceiver
{
public:
virtual bool OnEvent(const SEvent& event)
{
if (event.EventType == EET_GUI_EVENT)
{
s32 id = event.GUIEvent.Caller->getID();
switch(event.GUIEvent.EventType)
{
case EGET_BUTTON_CLICKED:
switch(id)
{
case 20:
guienv->addFileOpenDialog(L"Select a file, then click OK", true, 0, 10 );
return true;
}
case EGET_FILE_SELECTED:
switch(id)
{
case 10:
{
IGUIFileOpenDialog* dialog = (IGUIFileOpenDialog*)event.GUIEvent.Caller;
guiTest->setText( dialog->getFileName() );
return true;
}
default:
return false;
}
break;
default:
break;
}
}
return false;
}
};
int main()
{
IrrlichtDevice *device = createDevice( video::EDT_OPENGL, dimension2d<u32>(640, 480), 16, false, false, false, 0);
if (!device)return 1;
device->setWindowCaption(L"WHY ALL LOWER-CASE FILENAMES?!");
MyEventReceiver receiver;
device->setEventReceiver(&receiver);
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
guienv = device->getGUIEnvironment();
guienv->addButton(rect<s32>(100,100,540,380), 0, 20, L"CLICK ME!!", L"Opens FileOpenDialogue");
guiTest = guienv->addStaticText(L"", rect<s32>(20,20,620,42), true);
while(device->run())
{
driver->beginScene(true, true, SColor(255,100,101,140));
smgr->drawAll();
guienv->drawAll();
driver->endScene();
}
device->drop();
return 0;
}