Sign in to follow this  

Should my 2D engine use ID3DXSPRITE for tiles?

This topic is 3741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm working on a simple 2D engine in DirectX 9 and am already using ID3DXSPRITE for my sprites... Should I be using ID3DXSPRITE for my tiles (it's a scrolling tile-based engine) too or is there another alternative? Right now I'm just blitting from surface to the screen and it seems okay, but I feel like there should be a better way.

Share this post


Link to post
Share on other sites
Here's another dumb question - but related... Since I'm going to be using ID3DXSPRITE for everything, do I need to even define my own custom vertex format like so?

struct Vertex
{
float x, y, z, rhw;
D3DCOLOR color;
float u, v;
};


Edit:

Additionally, would these be correct?

CreateVertexBuffer(sizeof(LPD3DXSPRITE) * num, NULL, D3DFVF_VERTEX, D3DPOOL_MANAGED, &vertexBuffer, NULL);
d3ddev->SetStreamSource(0, vertexBuffer, 0, sizeof(LPD3DXSPRITE));

Instead of passing in my custom vertex format, would I pass in the LP3DXSPRITE? I could be way off base here, so please let me know if I am.

[Edited by - Gary the Llama on September 16, 2007 1:40:02 PM]

Share this post


Link to post
Share on other sites

This topic is 3741 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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