XNA Buffers

Started by
3 comments, last by MrCpaw 14 years, 10 months ago
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?
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.
Thanks, I'll be sure to check that out and post back later if I still run into any problems.
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.
What I was looking for was RenderTarget2D. Thanks for the help, I've been able to successfully setup my drawing areas.

This topic is closed to new replies.

Advertisement