Jump to content
  • Advertisement
Sign in to follow this  
MrCpaw

XNA Buffers

This topic is 3330 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 confused on how to go about making different buffers. I come from using C and C++ and with the API's I used I needed to setup my own buffers and have the option of having a buffer on the left and right. Which really is no different then having two bitmaps which you draw on. I wanted to do the same within XNA, however I'm unsure on how to go about doing so. I know in XNA you just use spriteBatch.Draw() to draw on the screen. However, I'm more use to doing something like this: draw(Buffer, GFX, X, Y, ect...); How would I go about setting up two buffers?

Share this post


Link to post
Share on other sites
Advertisement
Read up on MSDN for the constructors for SpriteBatch, you can specify a position and a size for your textures to be drawn to.

By buffers I'm assuming you mean render target textures.

Share this post


Link to post
Share on other sites
Thanks, I'll be sure to check that out and post back later if I still run into any problems.

Share this post


Link to post
Share on other sites
Are you talking about vertex and index buffers? These are available in XNA with pretty much the exact same functionality that's available in native D3D9. You can just create new instances of VertexBuffer and IndexBuffer, fill them with data using SetData, and then use GraphicsDevice.DrawIndexedPrimitives to draw them.

Share this post


Link to post
Share on other sites
What I was looking for was RenderTarget2D. Thanks for the help, I've been able to successfully setup my drawing areas.

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!