Jump to content

String error


DarthRaff
 Share

Recommended Posts

Hello,

 

i'm making a function to load a number of textures to make an animated one.

 

void LoadTextureSeq(string name,int num)
{
TTexture tex[4];
string path="objs/monsters/DK1/";
string tn;
int n;
for(n=1;n!=num;n++)
{
	tn=path;
	tn+=name;
	tn+=n;
	tn+=".dds";
	tex[n-1]=LoadTexture(tn);

}
}
.
.
.
LoadTextureSeq("electric",5);

 

this gives me that error:

 

error C2664: 'LoadTexture' : cannot convert parameter 1 from 'std::string' to 'str'

 

Please, what am i doing wrong ? thank you.

Link to comment
Share on other sites

Hello,

 

i'm making a function to load a number of textures to make an animated one.

 

void LoadTextureSeq(string name,int num)
{
TTexture tex[4];
string path="objs/monsters/DK1/";
string tn;
int n;
for(n=1;n!=num;n++)
{
	tn=path;
	tn+=name;
	tn+=n;
	tn+=".dds";
	tex[n-1]=LoadTexture(tn);

}
}
.
.
.
LoadTextureSeq("electric",5);

 

this gives me that error:

 

error C2664: 'LoadTexture' : cannot convert parameter 1 from 'std::string' to 'str'

 

Please, what am i doing wrong ? thank you.

 

tex[n-1]=LoadTexture( (str)tn.c_str() );

Roland Strålberg
Website: https://rstralberg.com

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...