Gorgon Game Engine
Gorgon Namespace Reference

Root namespace for Gorgon Game Engine. More...

Namespaces

 Animation
 This namespace contains animation related functionality.
 
 Audio
 Contains audio subsystem. For audio primitives look into multimedia namespace.
 
 CGI
 
 Containers
 This namespace contains containers that are missing from STL or specifically crafted for game or GUI development.
 
 Encoding
 
 Filesystem
 Contains filesystem functions.
 
 Geometry
 This namespace contains geometric element classes.
 
 GL
 This namespace contains underlying graphics library functions.
 
 Graphics
 Contains generic 2D graphics related data structures and functions.
 
 Input
 This namespace contains general input related functionality.
 
 internal
 
 IO
 
 OS
 This namespace contains operating system related functionality.
 
 Resource
 This namespace contains all Gorgon resources.
 
 Scripting
 This namespace contains Gorgon Script parser and reflection facilities.
 
 String
 Contains string related functions and classes. This namespace is not yet utf8 aware.
 
 Threading
 Contains multi-threading functions and objects.
 
 Time
 This module contains time related information.
 
 TMP
 
 UI
 This namespace contains User interface related functionality.
 
 Utils
 
 Widgets
 
 WindowManager
 This namespace contains window manager specific functionality.
 

Classes

class  Any
 This class can hold any other information providing type erasure. More...
 
class  AssumeOwnershipTag
 Where acceptable, denotes that the object will assume the ownership. More...
 
class  BinaryProperty
 Supports all operators that the numeric property supports. More...
 
class  BooleanProperty
 Supports logic operators. More...
 
class  Empty
 A class that has no members and can be used as placeholder. More...
 
class  Event
 This class provides event mechanism. More...
 
class  ExchangeData
 Base object for data to be exchanged. More...
 
class  FileData
 Stores list of files for data exchange. More...
 
struct  GetElm
 
struct  GetElm< 0, T1_, T_... >
 
struct  GetElm< N, T1_, T_... >
 
class  Layer
 This class is the base class for all layer types. More...
 
class  MouseHandler
 
class  MutableObjectProperty
 Object property allows the consumers of the property to be able to access objects member functions and variables. More...
 
class  NumericProperty
 Supports arithmetic operators including +, * ..., +=, ... More...
 
class  ObjectProperty
 Object property allows the consumers of the property to be able to access object's member functions and data members in a const manner. More...
 
class  Property
 This is generic property that can be set and retrieved good for enums mostly, its ok to use with POD structs for direct assignment but better not to use it with complex data types. More...
 
class  Range
 This class represents a range of values. More...
 
class  ReferenceProperty
 Reference property allows clients to access a reference object within the class. More...
 
class  Runner
 Defines the abstract class of Runner. More...
 
class  Scene
 This class represents a scene in the game like menu screen in game, post game, pause or different game modes. More...
 
class  SceneManager
 This class is a Window that manages scenes, allowing swapping, handling input and game loop. More...
 
class  SGuid
 This class represents a short globally unique identifier. More...
 
class  StructDefiner
 
class  TextData
 Stores text data for data exchange. More...
 
class  TextualProperty
 Supports everything that string class supports including +, +=, length() More...
 
class  Updatable
 Marks an object that can be updated. More...
 
class  Window
 This class represents a window. More...
 

Typedefs

typedef unsigned char Byte
 Represents smallest cell in memory. More...
 
typedef uint32_t Char
 
typedef intptr_t EventToken
 Generic type to store event tokens. More...
 
typedef float Float
 Represents floating point data type. More...
 
using SceneID = int
 Can be used to identify scenes. More...
 

Enumerations

enum  ItemPosition {
  Nowhere, Alone, First, Middle,
  Last
}
 Defines where an item is located in a list. More...
 
enum  Parity { None, Odd, Even }
 Marks the parity as Odd or Even. More...
 
enum  YesNoAuto { No, Yes, Auto }
 This enumeration helps with systems that has boolen parameters that can be detected automatically, but can also be overriden. More...
 
enum  YesNoUnset { No, Yes, Unset }
 This enumeration helps with systems that has boolen parameters that can be unset/empty. More...
 

Functions

template<class T_ >
std::vector< T_ >::const_iterator begin (enum_type_id< T_ >)
 
template<class T_ >
bool Between (Range< T_ > range, T_ v)
 Returns if the given number is within the given range including min but excluding max. More...
 
template<class T_ >
bool Between (T_ v, T_ min, T_ max)
 Returns if the given number is within the given range including min but excluding max. More...
 
template<class T_ >
bool BetweenInclusive (T_ v, T_ min, T_ max)
 Returns if the given number is within the given range including min and max. More...
 
uint32_t CeilToPowerOf2 (uint32_t v)
 Calculate the smalllest power of two larger than this value. More...
 
template<class T_ >
T_ Clamp (T_ v, T_ min, T_ max)
 Performs clamping on the given value and returns the result. More...
 
template<class T_ >
std::vector< T_ >::const_iterator end (enum_type_id< T_ >)
 
template<class T_ >
std::enable_if< decltype(gorgon__enum_tr_loc(T_()))::isupgradedenum, enum_type_id< T_ > >::type Enumerate ()
 Allows enumeration of upgraded enums using range based for. More...
 
template<class T_ >
void FitInto (T_ &v, T_ min, T_ max)
 Performs clamping on the given value. More...
 
std::string GetSystemName ()
 Returns the name of the current system. More...
 
void Initialize (const std::string &systemname)
 Initializes the entire system except for graphics and UI. More...
 
void NextFrame ()
 This function marks the end of current frame and starts the next one. More...
 
int NumberOfSetBits (uint32_t i)
 Returns the number of bits that are 1 in a number. More...
 
template<class C_ , class T_ , T_(C_::*)() const Getter_, void(C_::*)(const T_ &) Setter_>
T_ operator+ (const char *v, TextualProperty< C_, T_, Setter_, Getter_ > &t)
 
template<class C_ , class T_ , T_(C_::*)() const Getter_, void(C_::*)(const T_ &) Setter_>
T_ operator+ (const T_ &v, TextualProperty< C_, T_, Setter_, Getter_ > &t)
 
template<class C_ , class T_ , T_(C_::*)() const Getter_, void(C_::*)(const T_ &) Setter_>
T_ operator+ (TextualProperty< C_, T_, Setter_, Getter_ > &t, const char *v)
 
template<class C_ , class T_ , T_(C_::*)() const Getter_, void(C_::*)(const T_ &) Setter_>
T_ operator+ (TextualProperty< C_, T_, Setter_, Getter_ > &t, const T_ &v)
 
template<class C_ , class T_ , T_(C_::*)() const G_, void(C_::*)(const T_ &) S_>
std::ostream & operator<< (std::ostream &out, const NumericProperty< C_, T_, G_, S_ > &p)
 
template<class C_ , class T_ , T_(C_::*)() const G_, void(C_::*)(const T_ &) S_>
std::ostream & operator<< (std::ostream &out, const TextualProperty< C_, T_, G_, S_ > &p)
 
std::ostream & operator<< (std::ostream &stream, const SGuid &guid)
 Inserts an SGuid to a stream. More...
 
template<class C_ , class T_ , T_(C_::*)() const G_, void(C_::*)(const T_ &) S_>
std::istream & operator>> (std::istream &in, NumericProperty< C_, T_, G_, S_ > &p)
 
std::istream & operator>> (std::istream &in, SGuid &guid)
 Extracts an SGuid from a stream. Allows an optional % at the beginning. More...
 
template<class C_ , class T_ , T_(C_::*)() const G_, void(C_::*)(const T_ &) S_>
std::istream & operator>> (std::istream &in, TextualProperty< C_, T_, G_, S_ > &p)
 
template<typename T_ >
T_ PositiveMod (T_ value, T_ mod)
 
void RegisterOnce (std::function< void()> fn)
 Registers a function to be run at the start of the next frame. More...
 
void Render ()
 This function calls the starts the rendering pipeline. More...
 
void ResetTransform (const Geometry::Size &size)
 This should be called by the windows to reset transformation stack. More...
 
template<typename T_ >
int Sign (T_ val)
 
template<class Source_ , class... Args_>
void swap (Event< Source_, Args_... > &l, Event< Source_, Args_... > &r)
 Swaps two events. More...
 
void Tick ()
 Performs various operations that are vital to system execution. More...
 
void UpdateFrame ()
 This method works similar to next frame, however, no delay is done. More...
 

Variables

Event BeforeFrameEvent
 
Geometry::Bounds Clip
 Current clipping size, for mouse and clipping events. More...
 
bool exiting
 
Graphics::RGBAf LayerColor
 
Geometry::Point Offset
 Current layer offset from the top left of the window. More...
 
std::vector< std::function< void()> > once
 
std::vector< Geometry::Boundsprev_Clip
 
std::vector< Geometry::Pointprev_Offset
 
std::vector< Geometry::Transform3Dprev_Transform
 
Geometry::Size ScreenSize
 
Geometry::Transform3D Transform
 Current layer transformation, only for render and mouse. More...
 

Detailed Description

Root namespace for Gorgon Game Engine.

IO Related functionality.

todo y-kerning support

Contains base class for all shaders ShaderBase and facilities for loading/compiling shaders.

Stream operations in this namespace do not check the validity of the stream. it is up to the caller

Typedef Documentation

◆ Byte

typedef unsigned char Byte

Represents smallest cell in memory.

◆ Char

typedef uint32_t Char

◆ EventToken

typedef intptr_t EventToken

Generic type to store event tokens.

◆ Float

typedef float Float

Represents floating point data type.

GORGON_USE_DOUBLE definition allows switching to double for precision sensitive functions.

◆ SceneID

using SceneID = int

Can be used to identify scenes.

Enumeration Type Documentation

◆ ItemPosition

enum ItemPosition
strong

Defines where an item is located in a list.

Enumerator
Nowhere 

Item not in the list.

Alone 

Item is alone in the list.

First 

Item is the first item.

Middle 

Does not mean exact middle.

Last 

Item is the last item.

◆ Parity

enum Parity
strong

Marks the parity as Odd or Even.

Not every target will support None, but it is provided for places that support it.

Enumerator
None 
Odd 
Even 

◆ YesNoAuto

enum YesNoAuto
strong

This enumeration helps with systems that has boolen parameters that can be detected automatically, but can also be overriden.

Enumerator
No 
Yes 
Auto 

◆ YesNoUnset

enum YesNoUnset
strong

This enumeration helps with systems that has boolen parameters that can be unset/empty.

Enumerator
No 
Yes 
Unset 

Function Documentation

◆ begin()

std::vector<T_>::const_iterator Gorgon::begin ( enum_type_id< T_ >  )

◆ Between() [1/2]

bool Gorgon::Between ( Range< T_ >  range,
T_  v 
)

Returns if the given number is within the given range including min but excluding max.

References Range< T_ >::End, and Range< T_ >::Start.

◆ Between() [2/2]

bool Gorgon::Between ( T_  v,
T_  min,
T_  max 
)

Returns if the given number is within the given range including min but excluding max.

◆ BetweenInclusive()

bool Gorgon::BetweenInclusive ( T_  v,
T_  min,
T_  max 
)

Returns if the given number is within the given range including min and max.

◆ CeilToPowerOf2()

uint32_t Gorgon::CeilToPowerOf2 ( uint32_t  v)

Calculate the smalllest power of two larger than this value.

◆ Clamp()

T_ Gorgon::Clamp ( T_  v,
T_  min,
T_  max 
)

Performs clamping on the given value and returns the result.

◆ end()

std::vector<T_>::const_iterator Gorgon::end ( enum_type_id< T_ >  )

◆ Enumerate()

std::enable_if<decltype(gorgon__enum_tr_loc(T_()))::isupgradedenum, enum_type_id<T_> >::type Gorgon::Enumerate ( )

Allows enumeration of upgraded enums using range based for.

for(auto e : Enumerate<MyEnum>()) {
std::cout<<e<<std::endl;
}

◆ FitInto()

void Gorgon::FitInto ( T_ &  v,
T_  min,
T_  max 
)

Performs clamping on the given value.

◆ GetSystemName()

std::string Gorgon::GetSystemName ( )

Returns the name of the current system.

References Gorgon::internal::systemname.

◆ Initialize()

void Initialize ( const std::string &  systemname)

Initializes the entire system except for graphics and UI.

Graphics should be initialized after a window is created and UI should be initialized last.

References Gorgon::Audio::Initialize(), Gorgon::Filesystem::Initialize(), Gorgon::Resource::Initialize(), Gorgon::Scripting::Initialize(), Gorgon::WindowManager::Initialize(), and Gorgon::internal::systemname.

◆ NextFrame()

void NextFrame ( )

This function marks the end of current frame and starts the next one.

This function calls the Tick function at start of the next frame. Additionally, this function calls end of frame tasks such as rendering. Before starting the next frame, a certain delay is performed. This delay aims to set each frame duration to 16ms, this duration sets the frames per second to 62.5. This delay greatly reduces the system load of simple games/applications.

References BeforeFrameEvent, Gorgon::Time::FrameStart(), Gorgon::Time::GetTime(), Gorgon::OS::processmessages(), Render(), and Tick().

◆ NumberOfSetBits()

int Gorgon::NumberOfSetBits ( uint32_t  i)

Returns the number of bits that are 1 in a number.

◆ operator+() [1/4]

T_ Gorgon::operator+ ( const char *  v,
TextualProperty< C_, T_, Setter_, Getter_ > &  t 
)

◆ operator+() [2/4]

T_ Gorgon::operator+ ( const T_ &  v,
TextualProperty< C_, T_, Setter_, Getter_ > &  t 
)

◆ operator+() [3/4]

T_ Gorgon::operator+ ( TextualProperty< C_, T_, Setter_, Getter_ > &  t,
const char *  v 
)

◆ operator+() [4/4]

T_ Gorgon::operator+ ( TextualProperty< C_, T_, Setter_, Getter_ > &  t,
const T_ &  v 
)

◆ operator<<() [1/3]

std::ostream& Gorgon::operator<< ( std::ostream &  out,
const NumericProperty< C_, T_, G_, S_ > &  p 
)

◆ operator<<() [2/3]

std::ostream& Gorgon::operator<< ( std::ostream &  out,
const TextualProperty< C_, T_, G_, S_ > &  p 
)

◆ operator<<() [3/3]

std::ostream& Gorgon::operator<< ( std::ostream &  stream,
const SGuid guid 
)

Inserts an SGuid to a stream.

◆ operator>>() [1/3]

std::istream& Gorgon::operator>> ( std::istream &  in,
NumericProperty< C_, T_, G_, S_ > &  p 
)

◆ operator>>() [2/3]

std::istream& Gorgon::operator>> ( std::istream &  in,
SGuid guid 
)

Extracts an SGuid from a stream. Allows an optional % at the beginning.

References SGuid::Bytes, and SGuid::Integer.

◆ operator>>() [3/3]

std::istream& Gorgon::operator>> ( std::istream &  in,
TextualProperty< C_, T_, G_, S_ > &  p 
)

◆ PositiveMod()

T_ Gorgon::PositiveMod ( T_  value,
T_  mod 
)

◆ RegisterOnce()

void RegisterOnce ( std::function< void()>  fn)

Registers a function to be run at the start of the next frame.

References once.

◆ Render()

void Render ( )

This function calls the starts the rendering pipeline.

Rendering should be last operation of a frame.

References Window::Windows.

◆ ResetTransform()

void Gorgon::ResetTransform ( const Geometry::Size size)

This should be called by the windows to reset transformation stack.

References basic_Size< T_ >::Height, basic_Transform3D< T_ >::Scale(), Transform, basic_Transform3D< T_ >::Translate(), and basic_Size< T_ >::Width.

◆ Sign()

int Gorgon::Sign ( T_  val)

◆ swap()

void Gorgon::swap ( Event< Source_, Args_... > &  l,
Event< Source_, Args_... > &  r 
)

Swaps two events.

References Event< Source_, Params_ >::Swap().

◆ Tick()

void Tick ( )

Performs various operations that are vital to system execution.

These include OS message handling, animation and sound progressions, time progression and delta time calculation. NextFrame function should be preferred if the frame delay is tolerable.

References Gorgon::Animation::Animate(), Gorgon::Time::internal::deltatime, Gorgon::Time::internal::framestart, Gorgon::Time::GetTime(), once, and Gorgon::OS::processmessages().

◆ UpdateFrame()

void UpdateFrame ( )

This method works similar to next frame, however, no delay is done.

This function allows an application to update the display and perform OS tasks while still continuing operation.

References BeforeFrameEvent, Gorgon::OS::processmessages(), Render(), and Tick().

Variable Documentation

◆ BeforeFrameEvent

Event BeforeFrameEvent

◆ Clip

Current clipping size, for mouse and clipping events.

◆ exiting

bool exiting

◆ LayerColor

Graphics::RGBAf LayerColor

◆ Offset

Current layer offset from the top left of the window.

◆ once

std::vector<std::function<void()> > once

◆ prev_Clip

std::vector<Geometry::Bounds> prev_Clip

◆ prev_Offset

std::vector<Geometry::Point> prev_Offset

◆ prev_Transform

std::vector<Geometry::Transform3D> prev_Transform

◆ ScreenSize

Geometry::Size ScreenSize

◆ Transform

Current layer transformation, only for render and mouse.