Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
Classes | Functions
System

System abstractions. More...

Classes

class  gf::Clock
 Utility class that measures the elapsed time. More...
 
class  gf::Queue< T >
 A simple concurrent queue. More...
 
class  gf::Time
 Represents a time value. More...
 

Functions

GF_CORE_API void gf::sleep (Time duration)
 Make the current thread sleep for a given duration. More...
 
constexpr gf::Time gf::literals::operator""_seconds (long double amount)
 User defined operator for creating times in seconds. More...
 
constexpr gf::Time gf::literals::operator""_milliseconds (unsigned long long int amount)
 User defined operator for creating times in milliseconds. More...
 
constexpr gf::Time gf::literals::operator""_microseconds (unsigned long long int amount)
 User defined operator for creating times in microseconds. More...
 

Detailed Description

System abstractions.

Function Documentation

◆ operator""_microseconds()

constexpr gf::Time gf::literals::operator""_microseconds ( unsigned long long int  amount)
constexpr

User defined operator for creating times in microseconds.

To use it, you have to use the gf::literals namespace:

using namespace gf::literals;
gf::Time time = 13_microseconds;
Represents a time value.
Definition: Time.h:65
The namespace for literals.
See also
gf::microseconds()

◆ operator""_milliseconds()

constexpr gf::Time gf::literals::operator""_milliseconds ( unsigned long long int  amount)
constexpr

User defined operator for creating times in milliseconds.

To use it, you have to use the gf::literals namespace:

using namespace gf::literals;
gf::Time time = 42_milliseconds;
See also
gf::milliseconds()

◆ operator""_seconds()

constexpr gf::Time gf::literals::operator""_seconds ( long double  amount)
constexpr

User defined operator for creating times in seconds.

To use it, you have to use the gf::literals namespace:

using namespace gf::literals;
gf::Time time = 66.6_seconds;
See also
gf::seconds()

◆ sleep()

GF_CORE_API void gf::sleep ( Time  duration)

Make the current thread sleep for a given duration.

gf::sleep is the best way to block a program or one of its threads, as it doesn't consume any CPU power.

Parameters
durationThe time to sleep