Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Help with vertexArrays and Sprites  (Read 1503 times)

0 Members and 1 Guest are viewing this topic.

bacondude95

  • Newbie
  • *
  • Posts: 11
    • View Profile
Help with vertexArrays and Sprites
« 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.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Help with vertexArrays and Sprites
« Reply #1 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  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

bacondude95

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Help with vertexArrays and Sprites
« Reply #2 on: January 25, 2014, 06:47:10 am »
Thanks for your help  :)