Code: Select all
/*Here we load all the models and texture for the welcome menu. Here GetTexture works fine*/
driver = device->GetVideoDriver();
LoadWelcomeMenu(driver );
/*Draw the welcome menu until they pick a level*/
while(device->run() && !LevelPicked() )
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
}
/*Now that a level has been picked, let's load its geometry and textures. Here is where GetTexture fails even though the driver pointer is valid and we're trying to load a texture that does exist.*/
LoadLevel(driver);
/*Now draw the level but I never make it this far*/
while(device->run() && !LevelPicked() )
if (device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(0,200,200,200));
smgr->drawAll();
driver->endScene();
}
Code: Select all
video::ITexture* map = driver->getTexture("texutre.jpg");
EDIT: Changed to make code more concise.