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: 16
Joined: Mon Jun 17, 2019 7:45 am
x 1

load texture or load image ??

Post 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
paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: load texture or load image ??

Post 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
ksr921110
Gnoblar
Posts: 16
Joined: Mon Jun 17, 2019 7:45 am
x 1

Re: load texture or load image ??

Post 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.
Post Reply