get texture

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
emadof85
Posts: 31
Joined: Sun May 25, 2014 6:10 pm

get texture

Post by emadof85 »

i have some code which is true and work correctly
scene::IMeshSceneNode* node = 0;
irr::video::SMaterial& m = node->getMaterial(0);
how can I get the texture path or texture name from m ???
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: get texture

Post by Seven »

m.getTexture(index)->getName();
emadof85
Posts: 31
Joined: Sun May 25, 2014 6:10 pm

Re: get texture

Post by emadof85 »

const io::SNamedPath& mat = node->getMaterial(0).getTexture(0)->getName();
const path& p = mat.getPath();
in p there is an attribute named array that contain the path it return irr.fschar_t*
how to get stringw from it
Seven
Posts: 1034
Joined: Mon Nov 14, 2005 2:03 pm

Re: get texture

Post by Seven »

The good news is that converting to a stringw is easy

Stringw text( some char* variable)

Then use as text.c_str()
Post Reply