SFML community forums

Help => Graphics => Topic started by: 4B on April 14, 2014, 07:09:36 pm

Title: Drawing all vertices of a line to a sprite
Post by: 4B on April 14, 2014, 07:09:36 pm
The subject should already tell you what I want to know.

For reasons of performance, the lines can't be stored on vectors to draw them later, so I need to draw all points of a line to a sprite.
How am I supposed to do that?

Thanks.
Title: Re: Drawing all vertices of a line to a sprite
Post by: eXpl0it3r on April 14, 2014, 07:33:49 pm
You can't, but you can render everything to a render texture and use that texture as source for your sprite. ;)

For reasons of performance
Did you actually run into performance issues or are you just guessing widely that it's a performance issue?
Title: Re: Drawing all vertices of a line to a sprite
Post by: 4B on April 14, 2014, 07:41:43 pm
We're talking about 5000+ lines(I'm programming a spirograph). I already tested it with a lines-vector and the fps went down after 2000.

I'm going to try the RenderTexture thing and tell you if I got problems.
Title: Re: Drawing all vertices of a line to a sprite
Post by: eXpl0it3r on April 14, 2014, 07:43:30 pm
We're talking about 5000+ lines(I'm programming a spirograph). I already tested it with a lines-vector and the fps went down after 2000.
"FPS went down" doesn't say much, especially if you don't add the values, since FPS are not proportional. ;)

But yes a render texture might be a possibility then.
Title: Re: Drawing all vertices of a line to a sprite
Post by: 4B on April 14, 2014, 08:09:01 pm
Of course it won't drop exactly after 2000lines on your computer, but you wanted to know if I'm sure it leads to performance issues.

Anyway - I got it, thanks.