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

Author Topic: Cost of sf::Sprite and sf::Text  (Read 1678 times)

0 Members and 1 Guest are viewing this topic.

svrtgujbhk

  • Newbie
  • *
  • Posts: 20
    • View Profile
Cost of sf::Sprite and sf::Text
« on: April 11, 2011, 09:52:19 pm »
I'm curious how expensive it is to create sf::Sprite and sf::Text object from already existing sf::Image and sf::Font. Do they just keep a pointer to these objects or is there some more costly process going on?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Cost of sf::Sprite and sf::Text
« Reply #1 on: April 11, 2011, 10:05:06 pm »
Yes, the classes sf::Sprite, sf::Text, sf::Sound are just lightweight frontends to the heavyweight resources sf::Image, sf::Font, sf::SoundBuffer.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Cost of sf::Sprite and sf::Text
« Reply #2 on: April 11, 2011, 10:05:47 pm »
It is actually as light as it looks :D

Sprites are ultra-fast except if you consider that they are individual quads being drawn, which slows down the process :)