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

Author Topic: Drawing all vertices of a line to a sprite  (Read 4172 times)

0 Members and 1 Guest are viewing this topic.

4B

  • Newbie
  • *
  • Posts: 20
    • View Profile
Drawing all vertices of a line to a sprite
« 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.
If you're going to response to any of my comments, please avoid this smily: ";)"

I'd be grateful, thanks.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Drawing all vertices of a line to a sprite
« Reply #1 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

4B

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Drawing all vertices of a line to a sprite
« Reply #2 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.
If you're going to response to any of my comments, please avoid this smily: ";)"

I'd be grateful, thanks.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Drawing all vertices of a line to a sprite
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

4B

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Drawing all vertices of a line to a sprite
« Reply #4 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.
If you're going to response to any of my comments, please avoid this smily: ";)"

I'd be grateful, thanks.