   Question regarding to texture (DirectX)
  Hello guys, I think my question is a bit "noob" but I would still like to seek for some helps here...how am I going to create an array to store multiple textures?example:IDirect3DTexture9 texture = NULL; // this is just to create a variable to store 1 texturebut I want something like this:texture = "" texture[1] will have 1 texture inside while texture[2] will have another texture inside too.Kindly looking for reply...Thanks :)
  You want to declare it as:LPDIRECT3DTEXTURE9 texture[2];// Example:pDevice->SetTexture(0, texture[0]);;  Direct3D textures are used with pointers. So for example:IDirect3DTexture9* pMytexture = NULL;m_device->CreateTexture(..., &pMytexture);Commonly the Direct3D typedef LPDIRECT3DTEXTURE9 is used instead. If you want to have an array of textures you just store an array of pointers.IDirect3DTexture9** pTextures;or the more easy to read:LPDIRECT3DTEXTURE9* pTextures;;  then can i just use this:LPDIRECT3DTEXTURE9 pd3dTexture[2];instead of this?LPDIRECT3DTEXTURE9* pd3dTexture = new LPDIRECT3DTEXTURE9[2];;Quote:Original post by birdkingzthen can i just use this:LPDIRECT3DTEXTURE9 pd3dTexture[2];instead of this?LPDIRECT3DTEXTURE9* pd3dTexture = new LPDIRECT3DTEXTURE9[2];If you want a dynamic sized array of texture pointers, yes.   ;  Alright thanks alot :)I have 1 more question regarding to the String in directX.Let say now I wanna load a series of texture into the variable but I would like to use a loop do that.So how am I going to do with the file name?Should I use:char* fileName or this:LPCTSTR fileName Because I wanna do something like this:the file name is in sequence like picture1, picture2, picture3...so I wonder how am I going to do this?;I'd recommend reading this.And you should really use std::string or std::wstring.   ;  Alright, thanks :D   ;  Question again:I saw most of the people keep saying use thisstd::stringbut when i declare like thisstd::string file;I got many errors >.<- error C2653: 'std' : is not a class or namespace name- C2065: 'string' : undeclared identifierAnyone can help me again Is it I've forgot to include library?which library should I include?;  You need to #include <string> to include the std::string header.   