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

Author Topic: asMicroseconds Int64 or Uint64 ?  (Read 1535 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: 1843
    • View Profile
    • My GitHub Page
    • 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
ZipSavings, script to count rar/7z/zip savings: https://goo.gl/vvBj5M
LuaConsole: https://goo.gl/X4kRUk
FoxRaycaster: https://goo.gl/27nVS8
Small Games - Heart, Routing and Snek: https://goo.gl/15ZGWE https://goo.gl/k5gwWD https://goo.gl/4nKPnT
Botes - a notes app in Pascal: https://goo.gl/bzTqsi

 

anything