Need Help with Arrays of Cubes
Posted: Mon Sep 18, 2006 1:32 am
My C++ skills are weak so please forgive this noob post.
I am trying to create and render an array of textured cubes. The wierd thing is, while in debug mode, the code runs and renders the cubes without textures. The console shows an error message that texture <path> cannot be loaded.
When I run the executable outside of the IDE, the exe crashes. The console indicates that the texture is not found. The bitmap is in the correct path.
Here is the relavent portion of code, can someone please let me know what I am doing wrong here? Thanks in advance.
I am trying to create and render an array of textured cubes. The wierd thing is, while in debug mode, the code runs and renders the cubes without textures. The console shows an error message that texture <path> cannot be loaded.
When I run the executable outside of the IDE, the exe crashes. The console indicates that the texture is not found. The bitmap is in the correct path.
Here is the relavent portion of code, can someone please let me know what I am doing wrong here? Thanks in advance.
Code: Select all
irr::core::array<scene::ISceneNode*> cubes(3);
// create the cubes, set textures, position and
// set lighting
video::ITexture* cubeTex = driver->getTexture("wall.bmp");
for (int i = 0; i < cubeCount; i++)
{
cubes[i] = smgr->addCubeSceneNode();
cubes[i]->setPosition(vector3df( (float)(i * 10), 0, 0));
cubes[i]->setMaterialFlag(EMF_LIGHTING, false);
cubes[i]->setMaterialTexture(0, cubeTex);
}