Arctic Engine
Designed to give you control and not take anything away.
Collaboration diagram for Utility:

Classes

class  arctic::BitStream
 
class  arctic::CsvRow
 Represents a row in a CSV file. More...
 
class  arctic::CsvTable
 Represents a CSV table. More...
 
struct  arctic::DataReader
 A class for reading data from a buffer. More...
 
class  arctic::Utf32FromUtf16
 A class for converting UTF-16 encoded data to UTF-32. More...
 
struct  arctic::Utf32Reader
 A structure for reading UTF-32 characters from UTF-8 encoded data. More...
 
struct  arctic::Utf8Codepoint
 A structure representing a UTF-8 codepoint. More...
 

Enumerations

enum  arctic::CsvSourceType { arctic::kCsvSourceFile = 0 , arctic::kCsvSourcePure = 1 }
 Enumerates the types of CSV sources. More...
 

Functions

void arctic::Check (bool condition, const char *error_message, const char *error_message_postfix=nullptr)
 Exits the application with an error if condition is false. More...
 
void arctic::ExitProgram (Si32 exit_code=0)
 Exits the program. More...
 
void arctic::Fatal (const char *error_message, const char *message_postfix=nullptr)
 Exits the application with an error. More...
 
Si16 arctic::FromBe (Si16 x)
 Transform value from the big-endian representation. More...
 
Si32 arctic::FromBe (Si32 x)
 Transform value from the big-endian representation. More...
 
Ui16 arctic::FromBe (Ui16 x)
 Transform value from the big-endian representation. More...
 
Ui32 arctic::FromBe (Ui32 x)
 Transform value from the big-endian representation. More...
 
bool arctic::IsCursorVisible ()
 Returns true if the OS mouse cursor (pointer) is visible. More...
 
bool arctic::IsFullScreen ()
 Returns true if the application is running in Full Screen mode. More...
 
bool arctic::IsVSyncSupported ()
 Returns true if VSync is supported by the software and hardware. More...
 
Si64 arctic::Random (Si64 min, Si64 max)
 Returns a random number in range [min,max]. More...
 
Ui16 arctic::Random16 ()
 Returns a random Ui16. More...
 
Ui32 arctic::Random32 ()
 Returns a random Ui32. More...
 
Si32 arctic::Random32 (Si32 min, Si32 max)
 Returns a random number in range [min,max]. More...
 
Ui64 arctic::Random64 ()
 Returns a random Ui64. More...
 
Ui8 arctic::Random8 ()
 Returns a random Ui8. More...
 
void arctic::ResizeScreen (const Si32 width, const Si32 height)
 Set the backbuffer resolution in pixels. More...
 
void arctic::ResizeScreen (const Vec2Si32 size)
 Set the backbuffer resolution in pixels. More...
 
Vec2Si32 arctic::ScreenSize ()
 Get the backbuffer resolution in pixels.
 
void arctic::SetCursorVisible (bool is_enable)
 Sets OS mouse cursor visibility. More...
 
void arctic::SetFullScreen (bool is_enable)
 Toggles between the Full Screen mode and the Windowed mode. More...
 
void arctic::SetInverseY (bool is_inverse)
 Enables/disables Y-coordinate inversion. By default Y-axis is directed upward. More...
 
bool arctic::SetVSync (bool is_enable)
 Sets the VSync mode. More...
 
void arctic::Sleep (double duration_seconds)
 Waits for the time specified before returning. More...
 
void arctic::Swap ()
 Swaps virtual frontbuffer and backbuffer and updates user input.
 
double arctic::Time ()
 Returns time in seconds since the game start. More...
 
Si16 arctic::ToBe (Si16 x)
 Transform value to the big-endian representation. More...
 
Si32 arctic::ToBe (Si32 x)
 Transform value to the big-endian representation. More...
 
Ui16 arctic::ToBe (Ui16 x)
 Transform value to the big-endian representation. More...
 
Ui32 arctic::ToBe (Ui32 x)
 Transform value to the big-endian representation. More...
 
std::string arctic::Utf16ToUtf8 (const void *data)
 Convers a UTF-16 encoded string to UTF-8. More...
 
std::string arctic::Utf32ToUtf8 (const void *data)
 Convers a UTF-32 encoded string to UTF-8. More...
 
Vec2Si32 arctic::WindowSize ()
 Get the window size in actual pixels of the OS.
 

Detailed Description

Enumeration Type Documentation

◆ CsvSourceType

Enumerates the types of CSV sources.

Enumerator
kCsvSourceFile 

CSV source is a file.

kCsvSourcePure 

CSV source is a string.

Function Documentation

◆ Check()

void arctic::Check ( bool  condition,
const char *  error_message,
const char *  error_message_postfix = nullptr 
)

Exits the application with an error if condition is false.

Parameters
conditionCondition to check
[in]error_messageError message to display upon exiting
[in]error_message_postfixA postfix to append to the error message. Nothing is appended if error_message_postfix is nullptr

The function does not return if the condition is false

Here is the caller graph for this function:

◆ ExitProgram()

void arctic::ExitProgram ( Si32  exit_code = 0)

Exits the program.

Parameters
exit_codeExit code returned to the OS

◆ Fatal()

void arctic::Fatal ( const char *  error_message,
const char *  message_postfix = nullptr 
)

Exits the application with an error.

Parameters
[in]error_messageError message to display upon exiting
[in]message_postfixA postfix to append to the error message. Nothing is appended if error_message_postfix is nullptr

The function does not return

Here is the caller graph for this function:

◆ FromBe() [1/4]

Si16 arctic::FromBe ( Si16  x)

Transform value from the big-endian representation.

Parameters
[in]xBig-endian value to transform
Returns
Transformed value in local cpu-specific representation

◆ FromBe() [2/4]

Si32 arctic::FromBe ( Si32  x)

Transform value from the big-endian representation.

Parameters
[in]xBig-endian value to transform
Returns
Transformed value in local cpu-specific representation

◆ FromBe() [3/4]

Ui16 arctic::FromBe ( Ui16  x)

Transform value from the big-endian representation.

Parameters
[in]xBig-endian value to transform
Returns
Transformed value in local cpu-specific representation
Here is the caller graph for this function:

◆ FromBe() [4/4]

Ui32 arctic::FromBe ( Ui32  x)

Transform value from the big-endian representation.

Parameters
[in]xBig-endian value to transform
Returns
Transformed value in local cpu-specific representation

◆ IsCursorVisible()

bool arctic::IsCursorVisible ( )

Returns true if the OS mouse cursor (pointer) is visible.

Returns
true if the OS mouse cursor (pointer) is visible

◆ IsFullScreen()

bool arctic::IsFullScreen ( )

Returns true if the application is running in Full Screen mode.

Returns
true if the application is running in Full Screen mode

◆ IsVSyncSupported()

bool arctic::IsVSyncSupported ( )

Returns true if VSync is supported by the software and hardware.

Returns
true if VSync is supported by the software and hardware

◆ Random()

Si64 arctic::Random ( Si64  min,
Si64  max 
)

Returns a random number in range [min,max].

Parameters
minThe minimum value of the range (inclusive)
maxThe maximum value of the range (inclusive)
Returns
A random Si64 number within the specified range
Here is the call graph for this function:

◆ Random16()

Ui16 arctic::Random16 ( )

Returns a random Ui16.

Returns
A random Ui16 number
Here is the call graph for this function:

◆ Random32() [1/2]

Ui32 arctic::Random32 ( )

Returns a random Ui32.

Returns
A random Ui32 number
Here is the call graph for this function:

◆ Random32() [2/2]

Si32 arctic::Random32 ( Si32  min,
Si32  max 
)

Returns a random number in range [min,max].

Parameters
minThe minimum value of the range (inclusive)
maxThe maximum value of the range (inclusive)
Returns
A random Si32 number within the specified range
Here is the call graph for this function:

◆ Random64()

Ui64 arctic::Random64 ( )

Returns a random Ui64.

Returns
A random Ui64 number
Here is the call graph for this function:

◆ Random8()

Ui8 arctic::Random8 ( )

Returns a random Ui8.

Returns
A random Ui8 number
Here is the call graph for this function:

◆ ResizeScreen() [1/2]

void arctic::ResizeScreen ( const Si32  width,
const Si32  height 
)

Set the backbuffer resolution in pixels.

Parameters
widthThe desired width of the backbuffer in pixels
heightThe desired height of the backbuffer in pixels
Here is the call graph for this function:

◆ ResizeScreen() [2/2]

void arctic::ResizeScreen ( const Vec2Si32  size)

Set the backbuffer resolution in pixels.

Parameters
sizeThe desired size of the backbuffer in pixels
Here is the call graph for this function:

◆ SetCursorVisible()

void arctic::SetCursorVisible ( bool  is_enable)

Sets OS mouse cursor visibility.

Parameters
is_enabletrue makes the cursor visible, false hides it

◆ SetFullScreen()

void arctic::SetFullScreen ( bool  is_enable)

Toggles between the Full Screen mode and the Windowed mode.

Parameters
is_enabletrue swithes the application into the Full Screen mode false switches the application into the Windowed mode

◆ SetInverseY()

void arctic::SetInverseY ( bool  is_inverse)

Enables/disables Y-coordinate inversion. By default Y-axis is directed upward.

Parameters
is_inverseIf true, inverts the Y-axis; if false, Y-axis is directed upward (default)
Here is the call graph for this function:

◆ SetVSync()

bool arctic::SetVSync ( bool  is_enable)

Sets the VSync mode.

Parameters
is_enabletrue enables VSync, false disables VSync
Returns
true if VSync mode is successfuly set
Here is the caller graph for this function:

◆ Sleep()

void arctic::Sleep ( double  duration_seconds)

Waits for the time specified before returning.

Parameters
duration_secondsThe duration to wait in seconds

◆ Time()

double arctic::Time ( )

Returns time in seconds since the game start.

Returns
Time in seconds as a double
Here is the call graph for this function:

◆ ToBe() [1/4]

Si16 arctic::ToBe ( Si16  x)

Transform value to the big-endian representation.

Parameters
[in]xLocal cpu-specific representation of a value to transform
Returns
Transformed value in big-endian representation

◆ ToBe() [2/4]

Si32 arctic::ToBe ( Si32  x)

Transform value to the big-endian representation.

Parameters
[in]xLocal cpu-specific representation of a value to transform
Returns
Transformed value in big-endian representation

◆ ToBe() [3/4]

Ui16 arctic::ToBe ( Ui16  x)

Transform value to the big-endian representation.

Parameters
[in]xLocal cpu-specific representation of a value to transform
Returns
Transformed value in big-endian representation

◆ ToBe() [4/4]

Ui32 arctic::ToBe ( Ui32  x)

Transform value to the big-endian representation.

Parameters
[in]xLocal cpu-specific representation of a value to transform
Returns
Transformed value in big-endian representation

◆ Utf16ToUtf8()

std::string arctic::Utf16ToUtf8 ( const void *  data)

Convers a UTF-16 encoded string to UTF-8.

Parameters
[in]dataAddress of the UTF-16 encoded string.
Returns
UTF-8 std::string.
Here is the call graph for this function:

◆ Utf32ToUtf8()

std::string arctic::Utf32ToUtf8 ( const void *  data)

Convers a UTF-32 encoded string to UTF-8.

Parameters
[in]dataAddress of the UTF-32 encoded string.
Returns
UTF-8 std::string.
Here is the call graph for this function: