load texture or load image ?? Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
ksr921110
Gnoblar
Posts: 7
Joined: Mon Jun 17, 2019 7:45 am

load texture or load image ??

Post by ksr921110 » Mon Jun 17, 2019 8:27 am

hello. im use ogre 1.12.0.
read file and filedata manual mesh create success.
i cant texture mapping.
error code, FileNotfoundException

Mycode
{
* * *
String strTexturePathName = "../../Resources/Mesh/";
strTexturePathName += vecSubSetInfo.at(i).strTextureFileName;

MaterialPtr pMaterial = MaterialManager::getSingleton().create(
strTexturePathName, "General", true);
Pass* pPass = pMaterial->getTechnique(0)->getPass(0);
TextureUnitState* pTexUnitState = pPass->createTextureUnitState();

Image img;
//1. error
img.load(strTexturePathName); // ex) strTexturePathName= ../../Resources/Mesh/abcdef.jpg
//2. error
TexturePtr pTexture = TextureManager::getSingleton().load(strTexturePathName, "General");
pTexUnitState->setTextureName(pTexture->getName());

sub->setMaterial(pMaterial);
}

i think path no problem.
but can't find path...

i hope runtime texture mapping. help me
0 x

paroj
OGRE Team Member
OGRE Team Member
Posts: 836
Joined: Sun Mar 30, 2014 2:51 pm
x 147
Contact:

Re: load texture or load image ??

Post by paroj » Mon Jun 17, 2019 1:18 pm

in ogre, you do not identify resources by path, but only by filename. The locations are managed separately through:
https://ogrecave.github.io/ogre/api/lat ... ement.html
1 x

ksr921110
Gnoblar
Posts: 7
Joined: Mon Jun 17, 2019 7:45 am

Re: load texture or load image ??

Post by ksr921110 » Mon Jun 17, 2019 2:18 pm

thx :D i solved problem.
i am using ResourceManager::getSingleton().addResourceLocation
but item error cannot find codec.
find init Root, forget loadPlugin codec
my mistake.. sry :lol:

i am bad english. thx reading.
0 x

Post Reply