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

Author Topic: SFML 2.0 Sprites, Textures, Images and Clock  (Read 5330 times)

0 Members and 1 Guest are viewing this topic.

Chocolatesheep

  • Newbie
  • *
  • Posts: 17
    • View Profile
SFML 2.0 Sprites, Textures, Images and Clock
« on: May 01, 2012, 02:17:17 pm »
Just needed to ask some some questions, I'm quite new to SFML and I only used 1.6, but now I switched over to 2.0
To load an image onto a sprite I normally would have used Sprite.SetImage(Image);
But now due to the lack of the SetImage(); function I have to use Sprite.setTexture(Texture);
What I'm asking is what's the difference between Images and Textures in SFML?
And why does the Clock.getElapsedTime() no longer return a number but a sf::Time class type?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: SFML 2.0 Sprites, Textures, Images and Clock
« Reply #1 on: May 01, 2012, 02:33:15 pm »
There's a Help forum with its own Graphics subforum, your post would fit better there.

  • sf::Image (SFML 1.6) has been split into two parts: The pixel container sf::Image and the OpenGL texture wrapper sf::Texture. This allows more flexibility, for example a texture that is too big can still be stored in sf::Image.
  • sf::Time has been introduced to allow people to work with their preferred unit (like seconds), while keeping a big precision also for larger time spans.
By the way, there are several forum threads which discuss these features in detail, use the forum search. The documentation is also an option.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything