Jump to content
  • Advertisement
Sign in to follow this  
IlyaZ

2D Drawing - Images

This topic is 4402 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

Hi, I've got a question. Let's say I want to draw an image on the screen. I create a Vertex Buffer etc. Load a texture onto it and display it. Why would I want to use a sprite for this? //IlyaZ

Share this post


Link to post
Share on other sites
Advertisement
If you choose to create a vertex buffer you'll have to render the object using DrawPrimitive function. You don't need a sprite for this.
I never used the sprite function (shame me [smile]) but if I remember right it spares you the burden of creating a vertex buffer. Someone correct me?

[Edited by - Calin on May 5, 2006 9:55:36 PM]

Share this post


Link to post
Share on other sites
Plus if you're going to be displaying multiple images on the scren then you're going to have to manage the vertex buffer as well, and the sprite interface saves you from having to do that. It can even sort sprites for you based on texture which is a goot thing.

bottom line is that it just saves you from some extra work.

Share this post


Link to post
Share on other sites
That is true but it does not let you set per vertex color which is something you might want to support. Also it is annoying to be able to use any sort of shaders once you go that route with ID3DXSprite. I would suggest writting something similar to it on your own. It is pretty easy to simulate the same thing that ID3DXSprite does and at the same time doing it yourself gives you more flexibility

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!