Skip to main content
updated project URL as codeplex is going offline soon, added markdown to code in text, fixed minor typo
Source Link
Pikalek
  • 12.5k
  • 5
  • 45
  • 52

You'll want to look at SpriteBatchSpriteBatch then which basically involves deferring any actual GPU draw calls until all the drawing has been completed and ready to be flushed to the GPU bugger. This is a very common approach to draw 100s or even 1000s of sprites on a screen at once without negative implications on the frame rate. There's a lot of different ways to implement SpriteBatching so I'll leave the exact implementation in OpenGL to you, but in a lot of implementations I've seen (MonoGame, Direct X ToolkitDirect X Toolkit) the 'Begin'Begin function of the SpriteBatchSpriteBatch will take a transform view matrix (which will translate, rotate and scale the sprites). iI suggest you look at the implementations I've linked to and derive your own. MonoGame has OpenGL components which will probably be of use to you.

You'll want to look at SpriteBatch then which basically involves deferring any actual GPU draw calls until all the drawing has been completed and ready to be flushed to the GPU bugger. This is a very common approach to draw 100s or even 1000s of sprites on a screen at once without negative implications on the frame rate. There's a lot of different ways to implement SpriteBatching so I'll leave the exact implementation in OpenGL to you, but in a lot of implementations I've seen (MonoGame, Direct X Toolkit) the 'Begin' function of the SpriteBatch will take a transform view matrix (which will translate, rotate and scale the sprites). i suggest you look at the implementations I've linked to and derive your own. MonoGame has OpenGL components which will probably be of use to you.

You'll want to look at SpriteBatch then which basically involves deferring any actual GPU draw calls until all the drawing has been completed and ready to be flushed to the GPU bugger. This is a very common approach to draw 100s or even 1000s of sprites on a screen at once without negative implications on the frame rate. There's a lot of different ways to implement SpriteBatching so I'll leave the exact implementation in OpenGL to you, but in a lot of implementations I've seen (MonoGame, Direct X Toolkit) the Begin function of the SpriteBatch will take a transform view matrix (which will translate, rotate and scale the sprites). I suggest you look at the implementations I've linked to and derive your own. MonoGame has OpenGL components which will probably be of use to you.

Source Link
Vaughan Hilts
  • 5.5k
  • 1
  • 33
  • 57

You'll want to look at SpriteBatch then which basically involves deferring any actual GPU draw calls until all the drawing has been completed and ready to be flushed to the GPU bugger. This is a very common approach to draw 100s or even 1000s of sprites on a screen at once without negative implications on the frame rate. There's a lot of different ways to implement SpriteBatching so I'll leave the exact implementation in OpenGL to you, but in a lot of implementations I've seen (MonoGame, Direct X Toolkit) the 'Begin' function of the SpriteBatch will take a transform view matrix (which will translate, rotate and scale the sprites). i suggest you look at the implementations I've linked to and derive your own. MonoGame has OpenGL components which will probably be of use to you.