DarthRaff Posted June 28, 2010 Share Posted June 28, 2010 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. Quote Link to comment Share on other sites More sharing options...
Roland Posted June 28, 2010 Share Posted June 28, 2010 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() ); Quote Roland Strålberg Website: https://rstralberg.com Link to comment Share on other sites More sharing options...
DarthRaff Posted June 28, 2010 Author Share Posted June 28, 2010 Hi, Now works perfect. Thank you very much Roland Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.