SFML community forums

Help => Graphics => Topic started by: bacondude95 on January 25, 2014, 06:07:19 am

Title: Help with vertexArrays and Sprites
Post by: bacondude95 on January 25, 2014, 06:07:19 am
I'm programming my first game and it wasn't until I got to vertex arrays that I was confused. I'm just stuck on the thought of what I should use vertex arrays for and what I should use sprites for. So I understand Vertex Arrays are lightweight and more efficient. But what could I use them for? I think you would use them for Tilemaps, and maybe just other stuff that doesn't affect the game play entirely. Would I use sprites for enemy's, and more dynamic things that could be moved and destroyed.

What I'm trying to ask is, can I still use sprites? The tutorial said you'll quickly fill your graphics card... but how much does that mean? And also is there a way to move vertex arrays?

Thank your for your time and any help you may have.
Title: Re: Help with vertexArrays and Sprites
Post by: zsbzsb on January 25, 2014, 06:23:02 am
Sprites are simple wrappers around a vertex array for each sprite. The advantage of vertex arrays is that you can batch draw calls to increase performance. However this comes at the cost of more complicated code to handle the vertex array.

In the end, don't bother using vertex arrays until you run into performance issues with just plain old sprites  ;)
Title: Re: Help with vertexArrays and Sprites
Post by: bacondude95 on January 25, 2014, 06:47:10 am
Thanks for your help  :)