Sign in to follow this  

XNA Buffers

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

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