Domanda

I have trying so hard for days to figure out the error I am receiving on this DirectX application I am doing, it is being worked on using DirectX SDK June 2010 version and in Visual Studio 2012. The error :

error C2664: 'D3DXCreateTextureFromFileExW' : cannot convert parameter 12 from 'D3DXIMAGE_INFO' to 'D3DXIMAGE_INFO *' 
1>          No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called

That is the error message I receive. Now here is the block of code it stems from.

D3DXCreateTextureFromFileEx(m_pD3DDevice, L"test.png", 0, 0, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_MANAGED, D3DX_DEFAULT, D3DX_DEFAULT, D3DCOLOR_XRGB(255, 0, 255), m_imageInfo, 0, m_pTexture);

and the image_info variable I have from the header file.

    D3DXIMAGE_INFO          m_imageInfo; 

I am 100% more information is needed I'm just not sure how much more without post the whole code on here which I'm not doing right off the bat because I know how frustrating it can be to try and read through.

È stato utile?

Soluzione

The function requires an LPDIRECT3DTEXTURE9*. Your variable you're attempting to pass is an IDirect3DTexture9*. They are not the same thing. According to this link

http://msdn.microsoft.com/en-us/library/windows/desktop/bb205909(v=vs.85).aspx

An LPDIRECT3DTEXTURE9 is defined as an IDirect3DTexture9*.

According to this link:.

http://msdn.microsoft.com/en-us/library/windows/desktop/bb172802(v=vs.85).aspx

The last parameter is an LPDIRECT3DTEXTURE9*, not an LPDIRECT3DTEXTURE9. So you need to pass an IDirect3DTexture9**, not an IDirect3DTexture9*.

If anything, I would suspect that the last parameter in your call should be &m_pTexture.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top