erm ok. i dunno whats gonna help tho.
The render function:
Code:
void CGfxEntitySprite::Render(const D3DXVECTOR3 *pos)
{
D3DXVECTOR2 pos2d=*pos;
m_sprite->Begin();
m_sprite->Draw(m_texture, NULL, NULL, NULL, 3.14f, &pos2d, 0xFFFFFFFF);
m_sprite->End();
}
Call from vis:
Code:
void CVisualisation::RenderEntity(int id, const D3DXVECTOR3 *pos)
{
gD3dDevice->Clear(0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255, 255, 255), 0, 0);
gD3dDevice->BeginScene();
Render(&pos);
gD3dDevice->EndScene();
gD3dDevice->Present(NULL, NULL, NULL, NULL);
}
.h declaration of class CGfxEntitySprite
Code:
class CGfxEntitySprite : public CGfxEntity
{
public:
CGfxEntitySprite() {};
virtual ~CGfxEntitySprite() {};
bool InitialiseSprite(const char* textureFilename);
void Render(const D3DXVECTOR3 *pos);
private:
LPD3DXSPRITE m_sprite;
LPDIRECT3DTEXTURE9 m_texture;
D3DXVECTOR3 pos;
};