Jump to content
  • Advertisement
Sign in to follow this  
slynk

XNA Draw to Texture2D?

This topic is 2704 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 have code where I draw some paths over a tile. I use triangle strips to accomplish it. I'm wanting to make a rotation animation by just rotating the texture. But to draw the paths during rotation I'd have to calculate the curves and convert them to triangle strips every update till the animation is over.

SO, I'm wondering, can I draw the triangle strips directly onto the texture? Then, after rotation. I replace it with a blank tile and draw the updated paths over it.

EDIT: Actually, if I can draw the path to the texture, I wouldn't even need to recalculate the curve.

Share this post


Link to post
Share on other sites
Advertisement

I have code where I draw some paths over a tile. I use triangle strips to accomplish it. I'm wanting to make a rotation animation by just rotating the texture. But to draw the paths during rotation I'd have to calculate the curves and convert them to triangle strips every update till the animation is over.

SO, I'm wondering, can I draw the triangle strips directly onto the texture? Then, after rotation. I replace it with a blank tile and draw the updated paths over it.

EDIT: Actually, if I can draw the path to the texture, I wouldn't even need to recalculate the curve.

You should look into RenderTarget2D and GraphicsDevice.SetRenderTarget(), which allows you to draw to a target other than the screen. I don't know of any XNA 4.0 tutorials for using these off-hand - be aware that they are one of the things which have changed slightly since version 3.1.


Share this post


Link to post
Share on other sites
You should look into RenderTarget2D and GraphicsDevice.SetRenderTarget(), which allows you to draw to a target other than the screen. I don't know of any XNA 4.0 tutorials for using these off-hand - be aware that they are one of the things which have changed slightly since version 3.1.


Hmm, I'll look into and post results here. Thanks.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!