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

Author Topic: Upgrading to SFML 2.0  (Read 2828 times)

0 Members and 1 Guest are viewing this topic.

MickeyKnox

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Upgrading to SFML 2.0
« on: June 12, 2011, 07:12:39 pm »
After switchin to SFML 2.0, i stumbled over a few issues.
Some things where easy to fix, like Sprite::SetCenter doesn't exist any
more, now it's SetOrigin.

But it took me a while to figure out, that Clock::GetElapsedTime now
returns an int with milliseconds resolution, instead of a float with seconds
resolution.

Is there some sort of tutorial or a collection of issues to consider when
upgrading? I think at least things like the change of Clock::GetElapsedTime
should be communicated somehow...

edit:
And i'm a little confused about the comment on GetElapsedTime:
Quote
Its resolution depends on the underlying OS, but you can generally expect a 1 ms resolution.

Isn't it the purpose of SFML, *NOT* having to worry about the underlying OS?

Lokk

  • Full Member
  • ***
  • Posts: 228
    • View Profile
    • http://betadineproject.wordpress.com/
Upgrading to SFML 2.0
« Reply #1 on: June 12, 2011, 07:23:54 pm »
SFML 2.0 is not released yet, but Laurent often communicate about major API breaks.

See here for the changes in sf::Clock :
http://www.sfml-dev.org/forum/viewtopic.php?t=4864

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Upgrading to SFML 2.0
« Reply #2 on: June 12, 2011, 07:24:36 pm »
Quote
Is there some sort of tutorial or a collection of issues to consider when
upgrading

Not yet, but there will be when SFML 2 is officially released.

Quote
Isn't it the purpose of SFML, *NOT* having to worry about the underlying OS?

I can't modify the resolution of the OS-specific timing functions, I can only take what they give me ;)
Laurent Gomila - SFML developer

MickeyKnox

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Upgrading to SFML 2.0
« Reply #3 on: June 12, 2011, 07:45:53 pm »
Quote
I can't modify the resolution of the OS-specific timing functions, I can only take what they give me


You can put such details in the OS specific implementation and hide it to the API. I thought this was the general approach.
The timing functions on unix have microseconds resolution. Thus, the API providing milliseconds resolution seems to me, that's what you did.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Upgrading to SFML 2.0
« Reply #4 on: June 12, 2011, 08:45:54 pm »
In fact what I do is to take a "safe" common resolution for all implementations. All the functions that I use are generally below 1 ms, so yes, in a way we could say that I've hidden the OS specificities -- but things are still not 100% sure ;)
Laurent Gomila - SFML developer

 

anything