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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TheMemo

Pages: [1]
1
Graphics / Drawing multiple sprites from same texture
« on: August 12, 2014, 11:58:29 pm »
Hi, I'm new to SFML, and I do quite like it. Just now I wrote a simple simulation of Conway's Game of Life. If you don't know what that is, it doesn't really matter, what matters is that you have to draw the same texture (a yellow square) to the screen multiple times at different positions (sometimes up to a few thousand times). Now, I'm wondering is there a significantly more efficient way of drawing the yellow squares (and nothing else, it's pretty rudimentary) than simply loading the texture (which is usually 3-10 pixels in height), linking a sprite to the texture, and then simply calling window.draw for every square for every frame. I don't think the code's gonna be really necessary here, it's 270 lines and quite awful.

Pages: [1]