Sign in to follow this  
savail

Does texture arrays work in D3DXCreateTextureFromFileEx?

Recommended Posts

savail    333
Hey
Im trying to create textures and save them in array by this way:
[code]LPDIRECT3DTEXTURE9 texture[200];
for(int i = 0; i < image.size(); i++)
{
HRESULT hr = D3DXCreateTextureFromFileEx(d3dDevice, image[i].c_str(), D3DX_DEFAULT_NONPOW2, D3DX_DEFAULT_NONPOW2, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, D3DX_FILTER_NONE, D3DX_DEFAULT, 0xFFFFFFFF, &SrcInfo, NULL, texture[i]);
}[/code]
but my IDE returns an error: cannot convert parameter 14 from 'LPDIRECT3DTEXTURE9' to 'LPDIRECT3DTEXTURE9 *'. I know that variable with type LPDIRECT3DTEXTURE9 is already a pointer but can't manage to make this work. I tried puting &texture[i] and it also didn't work

Share this post


Link to post
Share on other sites
Mussi    4409
[b]LPDIRECT3DTEXTURE9 *[/b] [i]ppTexture[/i] is a pointer to a pointer. You have an array of pointers so you'll have to pass their address to the function.

[quote name='savail' timestamp='1302949537' post='4799089']I tried puting &texture[i] and it also didn't work[/quote]

Hmm, why not?

Share this post


Link to post
Share on other sites
savail    333
ah Im stupid... there was also an error when I wrote &texture[i] but it haven't regarded to this function but to place where I had written texture->release() without index. Now im having just problems with vectors ;p, Thanks a lot anyway!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this