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

Author Topic: asMicroseconds Int64 or Uint64 ?  (Read 5245 times)

0 Members and 1 Guest are viewing this topic.

Rodd

  • Newbie
  • *
  • Posts: 43
    • View Profile
    • Email
asMicroseconds Int64 or Uint64 ?
« on: April 29, 2018, 11:57:03 pm »
Hello,

why the method asMicroseconds() returns Int64 and not UInt64  in Time.hpp ? :)

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: asMicroseconds Int64 or Uint64 ?
« Reply #1 on: April 30, 2018, 02:38:19 am »
Because sf::Time can represent a negative amount of time.

You can pass negative values to functions that return sf::Time and it has an unary - operator.

It's mentioned in the tutorial too so it's not a mistake or oversight: https://www.sfml-dev.org/tutorials/2.4/system-time.php
Back to C++ gamedev with SFML in May 2023