Page 1 of 1

load texture or load image ??

Posted: Mon Jun 17, 2019 8:27 am
by ksr921110
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

Re: load texture or load image ??

Posted: Mon Jun 17, 2019 1:18 pm
by paroj
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

Re: load texture or load image ??

Posted: Mon Jun 17, 2019 2:18 pm
by ksr921110
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.