![]() |
Gorgon Game Engine
|
This module contains time related information. More...
Namespaces | |
internal | |
Classes | |
class | Date |
This class represents a specific date including time information. More... | |
class | Timer |
Millisecond based timer. More... | |
Functions | |
unsigned long | DeltaTime () |
Returns the time passed since the last frame. More... | |
unsigned long | FrameStart () |
Returns start time of the current frame in milliseconds. More... | |
void | fromtm (Date &ret, tm timeinfo) |
Date | GetDate () |
Returns the current date. More... | |
unsigned long | GetTime () |
Returns current time in milliseconds. More... | |
void | Initialize () |
Initializes Time module. More... | |
std::ostream & | operator<< (std::ostream &out, const Date &date) |
Output stream operator overload. More... | |
std::ostream & | operator<< (std::ostream &output, const Timer &timer) |
Allows Timer to be printed. More... | |
tm | totm (const Date &d) |
This module contains time related information.
unsigned long Gorgon::Time::DeltaTime | ( | ) |
Returns the time passed since the last frame.
This value is updated at the start of the frame.
References Gorgon::Time::internal::deltatime.
unsigned long Gorgon::Time::FrameStart | ( | ) |
Returns start time of the current frame in milliseconds.
This function should be used for animations and effects as it is constant throughout a frame.
References Gorgon::Time::internal::framestart.
void Gorgon::Time::fromtm | ( | Date & | ret, |
tm | timeinfo | ||
) |
References Date::Day, Date::Hour, Date::Minute, Date::Month, Date::Second, Date::Weekday, and Date::Year.
Date GetDate | ( | ) |
Returns the current date.
Should not be used for performance calculations, its not guaranteed to be precise.
References Date::Day, Date::Hour, Date::Millisecond, Date::Minute, Date::Month, Date::Second, Date::Timezone, Date::Weekday, and Date::Year.
unsigned long GetTime | ( | ) |
Returns current time in milliseconds.
void Initialize | ( | ) |
Initializes Time module.
Initializes the filesystem module.
Gorgon system requires every module to have initialization function even if they are not used. Currently used for following tasks:
Set startup directory
There is a mechanism to ensure initialization is performed once.
References Gorgon::Time::internal::deltatime, Gorgon::Time::internal::framestart, and GetTime().
std::ostream& Gorgon::Time::operator<< | ( | std::ostream & | out, |
const Date & | date | ||
) |
Output stream operator overload.
References Date::ISODateTime().
std::ostream& Gorgon::Time::operator<< | ( | std::ostream & | output, |
const Timer & | timer | ||
) |
Allows Timer to be printed.
References Timer::Get().
tm Gorgon::Time::totm | ( | const Date & | d | ) |
References Date::Day, Date::Hour, Date::Minute, Date::Month, Date::Second, Date::Weekday, and Date::Year.