Archived

This topic is now archived and is closed to further replies.

johan_swe

How to use the new ID3DXSprite

Recommended Posts

I have installed the DX Summer Update, but ID3DXSprite doesn''t work. The code: m_pD3DXSprite->Begin(D3DXSPRITE_ALPHABLEND); m_pD3DXSprite->Draw(m_pTexture, NULL, &D3DXVECTOR3(m_Center.x, 0.0f, m_Center.y), &D3DXVECTOR3(m_Pos.x, 0.0f, m_Pos.y), 0xFFFFFFFF); m_pD3DXSprite->End(); It'' meanth to work just like the old ID3DXSprite interface, but it doesn''t render anything. All other DX-code (vbuffers, CD3DFont etc) works fine, just like before.

Share this post


Link to post
Share on other sites
Not that this is what's wrong, but a D3DXVECTOR3 is x,y,z... it appears you are using it as x,z,y, and maybe it has something to do with what you are setting the z-value to...

I also just leave 'center' as a NULL, and just set the position offset only.



------------------------------------------------------------
// TODO: Insert clever comment here.

[edited by - drowner on October 7, 2003 12:30:19 PM]

Share this post


Link to post
Share on other sites
I think you are right. Stupid mistake, of course it should be
m_pD3DXSprite->Draw(m_pTexture, NULL, &D3DXVECTOR3(m_Center.x, m_Center.y, 0.0f), &D3DXVECTOR3(m_Pos.x, m_Pos.y, 0.0f), 0xFFFFFFFF);

Share this post


Link to post
Share on other sites