If i take a look in CNullDriver.cpp at the ITexture* CNullDriver::getTexture(const c8* filename) function I notice it starts with this:
Code: Select all
// Identify textures by their absolute filenames.
core::stringc absolutePath = FileSystem->getAbsolutePath(filename);
ITexture* texture = findTexture(absolutePath.c_str());
if (texture)
return texture;
Code: Select all
c8 *p=0;
#ifdef _IRR_WINDOWS_API_
#if !defined ( _WIN32_WCE )
c8 fpath[_MAX_PATH];
p = _fullpath( fpath, filename.c_str(), _MAX_PATH);
#endif
#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
c8 fpath[4096];
p = realpath(filename.c_str(), fpath);
#endif
return core::stringc(p);
Concrete example:
code/main.cpp
resources/art/bitmaps/invalid.jpg
Code: Select all
int main()
{
IrrlichtDevice *device = createDevice(video::EDT_OPENGL, core::dimension2d<s32>(640, 480), 32, false, false, false);
if (device == 0)
return 1;
device->getFileSystem()->addFolderFileArchive("../resources", true, false);
video::ITexture *texture = device->getVideoDriver()->getTexture("art/bitmaps/invalid.jpg");
cout << "texture is " << (texture ? "valid" : "invalid") << endl;
device->drop();
return 0;
Thanks