GA::kit v0.3
G&A's in-house C++ application framework
Loading...
Searching...
No Matches
ga Namespace Reference

Namespaces

namespace  ease
 
namespace  json
 
namespace  math
 

Classes

class  Bounds
 
struct  Bounds3D
 A 3D axis-aligned bounding box. More...
 
class  Component
 
struct  Event
 
struct  FontStyle
 
class  Image
 
struct  KeyEvent
 
struct  MatrixScope
 
struct  MouseEvent
 
class  Node
 Node represents a basic "node" (or view) in the scenegraph. More...
 
class  Paragraph
 
struct  Rect
 A 2D axis-aligned rectangle, with x,y (float) position and w,h (float) size components.
More...
 
class  Renderer
 
class  ResourceCache
 resource cache class, represents a container for a resource type organized by name (string) More...
 
class  Scene
 Scene is a view controller. More...
 
struct  scope_guard
 
class  Timeline
 
struct  Timeout
 
class  TimeoutManager
 
class  Timer
 
class  Tint
 
struct  TouchEvent
 
class  TouchZone
 
class  Transform
 Transform represents a basic model matrix: translate * rotate * scale Stored internally as ga::mat4 (4x4 matrix) as well as: More...
 
class  Tween
 
class  TweenBase
 

Typedefs

using Color = ga::vec4
 
using EasingFn = std::function< float(float)>
 
using FontCache = ResourceCache< Font >
 
using Json = nlohmann::json
 
template<class... T>
using Signal = sigslot::signal< T... >
 
using Connection = sigslot::connection
 
using ScopedConnection = sigslot::scoped_connection
 
using Observer = sigslot::observer
 
using Clock = std::chrono::steady_clock
 
using TimePoint = std::chrono::time_point< Clock >
 
using Millis = std::chrono::milliseconds
 
using Uuid = xg::Guid
 

Enumerations

enum class  EaseType {
  LINEAR , EXPO_IN , EXPO_OUT , EXPO_IN_OUT ,
  CUBE_IN_QUAD_OUT , MATERIAL , MATERIAL_ENTER , MATERIAL_EXIT ,
  CUSTOM , NUM_TYPES , DEFAULT = LINEAR
}
 
enum class  HorzAlign { LEFT , CENTER , RIGHT }
 
enum class  VertAlign { TOP , MIDDLE , BOTTOM }
 
enum class  FitMode {
  NONE , FIT , STRETCH , COVER ,
  FIT_WIDTH , FIT_HEIGHT , FIT_DEPTH
}
 
enum class  MatrixType { MODEL , VIEW , PROJECTION }
 

Functions

std::function< float(float)> easeFn (const EaseType &type)
 
FontCachefontCache ()
 
void from_json (const ga::Json &j, ga::vec4 &v)
 
void to_json (ga::Json &j, const ga::vec4 &v)
 
void from_json (const ga::Json &j, ga::quat &q)
 
void to_json (ga::Json &j, const ga::quat &q)
 
void from_json (const ga::Json &j, ga::vec3 &v)
 
void to_json (ga::Json &j, const ga::vec3 &v)
 
void from_json (const ga::Json &j, ga::vec2 &v)
 
void to_json (ga::Json &j, const ga::vec2 &v)
 
void from_json (const ga::Json &j, ga::mat4 &m)
 
void to_json (ga::Json &j, const ga::mat4 &m)
 
vec2 anchor (HorzAlign h, VertAlign v)
 
vec3 calcScaleToFit (const vec3 &sourceSize, const vec3 &containerSize, const FitMode &fitMode)
 
vec2 calcScaleToFit (const vec2 &sourceSize, const vec2 &containerSize, const FitMode &fitMode)
 
template<typename T >
toDegrees (const T &radians)
 
double toDegrees (const double &radians)
 
template<typename T >
toRadians (const T &degrees)
 
double toRadians (const double &degrees)
 
template<typename T >
const T & clamp (const T &val, const T &min, const T &max)
 Clamp a value between a minimum and a maximum.
 
template<typename T >
map (const T &val, const T &inMin, const T &inMax, const T &outMin, const T &outMax, bool bClamp=false)
 Map a value from one range to another.
 
float map (const float &val, const float &inMin, const float &inMax, const float &outMin, const float &outMax, bool bClamp=false)
 
template<typename T >
lerp (const T &a, const T &b, const T &pct)
 
template<typename T >
lerp (const T &a, const T &b, float pct)
 
float lerp (float a, float b, float pct)
 
quat lerp (const quat &a, const quat &b, float pct)
 
quat slerp (const quat &a, const quat &b, float pct)
 
float cubicBezier (float x, float x1, float y1, float x2, float y2)
 
template<typename T >
interpolate (const T &a, const T &b, float pct, std::function< float(float)> easeFn, bool bClamp=false)
 
RenderergetRenderer ()
 
template<class ResourceT , class... Args>
bool loadResource (ResourceT &r, Args... args)
 
long timeMillis (const TimePoint &timePoint)
 
long timeMillis ()
 
long durMillis (const TimePoint &begin, const TimePoint &end)
 
std::ostream & operator<< (std::ostream &stream, const TimePoint &timePoint)
 
std::vector< std::string > splitString (const std::string &str, char delim=' ')
 
std::string toLower (std::string str)
 
std::string toUpper (std::string str)
 
Uuid newUuid ()
 

Typedef Documentation

◆ Clock

using ga::Clock = typedef std::chrono::steady_clock

◆ Color

using ga::Color = typedef ga::vec4

◆ Connection

◆ EasingFn

using ga::EasingFn = typedef std::function<float( float )>

◆ FontCache

using ga::FontCache = typedef ResourceCache<Font>

◆ Json

using ga::Json = typedef nlohmann::json

◆ Millis

using ga::Millis = typedef std::chrono::milliseconds

◆ Observer

◆ ScopedConnection

◆ Signal

template<class... T>
using ga::Signal = typedef sigslot::signal<T...>

◆ TimePoint

using ga::TimePoint = typedef std::chrono::time_point<Clock>

◆ Uuid

using ga::Uuid = typedef xg::Guid

Enumeration Type Documentation

◆ EaseType

enum class ga::EaseType
strong
Enumerator
LINEAR 
EXPO_IN 
EXPO_OUT 
EXPO_IN_OUT 
CUBE_IN_QUAD_OUT 
MATERIAL 
MATERIAL_ENTER 
MATERIAL_EXIT 
CUSTOM 
NUM_TYPES 
DEFAULT 

◆ FitMode

enum class ga::FitMode
strong
Enumerator
NONE 
FIT 
STRETCH 
COVER 
FIT_WIDTH 
FIT_HEIGHT 
FIT_DEPTH 

◆ HorzAlign

enum class ga::HorzAlign
strong
Enumerator
LEFT 
CENTER 
RIGHT 

◆ MatrixType

enum class ga::MatrixType
strong
Enumerator
MODEL 
VIEW 
PROJECTION 

◆ VertAlign

enum class ga::VertAlign
strong
Enumerator
TOP 
MIDDLE 
BOTTOM 

Function Documentation

◆ anchor()

vec2 ga::anchor ( HorzAlign  h,
VertAlign  v 
)
inline

◆ calcScaleToFit() [1/2]

vec2 ga::calcScaleToFit ( const vec2 &  sourceSize,
const vec2 &  containerSize,
const FitMode fitMode 
)
inline

◆ calcScaleToFit() [2/2]

vec3 ga::calcScaleToFit ( const vec3 &  sourceSize,
const vec3 &  containerSize,
const FitMode fitMode 
)
inline

◆ clamp()

template<typename T >
const T & ga::clamp ( const T &  val,
const T &  min,
const T &  max 
)
inline

Clamp a value between a minimum and a maximum.

Template Parameters
Ttype must support < and > comparison

◆ cubicBezier()

float ga::cubicBezier ( float  x,
float  x1,
float  y1,
float  x2,
float  y2 
)
inline

◆ durMillis()

long ga::durMillis ( const TimePoint begin,
const TimePoint end 
)
inline

◆ easeFn()

std::function< float(float)> ga::easeFn ( const EaseType type)
inline

◆ fontCache()

FontCache & ga::fontCache ( )
inline

◆ from_json() [1/5]

void ga::from_json ( const ga::Json j,
ga::mat4 &  m 
)
inline

◆ from_json() [2/5]

void ga::from_json ( const ga::Json j,
ga::quat &  q 
)
inline

◆ from_json() [3/5]

void ga::from_json ( const ga::Json j,
ga::vec2 &  v 
)
inline

◆ from_json() [4/5]

void ga::from_json ( const ga::Json j,
ga::vec3 &  v 
)
inline

◆ from_json() [5/5]

void ga::from_json ( const ga::Json j,
ga::vec4 &  v 
)
inline

◆ getRenderer()

Renderer & ga::getRenderer ( )
inline

◆ interpolate()

template<typename T >
T ga::interpolate ( const T &  a,
const T &  b,
float  pct,
std::function< float(float)>  easeFn,
bool  bClamp = false 
)
inline

◆ lerp() [1/4]

quat ga::lerp ( const quat &  a,
const quat &  b,
float  pct 
)
inline

◆ lerp() [2/4]

template<typename T >
T ga::lerp ( const T &  a,
const T &  b,
const T &  pct 
)
inline

◆ lerp() [3/4]

template<typename T >
T ga::lerp ( const T &  a,
const T &  b,
float  pct 
)
inline

◆ lerp() [4/4]

float ga::lerp ( float  a,
float  b,
float  pct 
)
inline

◆ loadResource()

template<class ResourceT , class... Args>
bool ga::loadResource ( ResourceT &  r,
Args...  args 
)

◆ map() [1/2]

float ga::map ( const float &  val,
const float &  inMin,
const float &  inMax,
const float &  outMin,
const float &  outMax,
bool  bClamp = false 
)
inline

◆ map() [2/2]

template<typename T >
T ga::map ( const T &  val,
const T &  inMin,
const T &  inMax,
const T &  outMin,
const T &  outMax,
bool  bClamp = false 
)
inline

Map a value from one range to another.

Optionally, clamp the result to stay within the output range.

Template Parameters
Ttype must support +, -, /, * operators (and <,> for clamp)

◆ newUuid()

Uuid ga::newUuid ( )
inline

◆ operator<<()

std::ostream & ga::operator<< ( std::ostream &  stream,
const TimePoint timePoint 
)
inline

◆ slerp()

quat ga::slerp ( const quat &  a,
const quat &  b,
float  pct 
)
inline

◆ splitString()

std::vector< std::string > ga::splitString ( const std::string &  str,
char  delim = ' ' 
)
inline

◆ timeMillis() [1/2]

long ga::timeMillis ( )
inline

◆ timeMillis() [2/2]

long ga::timeMillis ( const TimePoint timePoint)
inline

◆ to_json() [1/5]

void ga::to_json ( ga::Json j,
const ga::mat4 &  m 
)
inline

◆ to_json() [2/5]

void ga::to_json ( ga::Json j,
const ga::quat &  q 
)
inline

◆ to_json() [3/5]

void ga::to_json ( ga::Json j,
const ga::vec2 &  v 
)
inline

◆ to_json() [4/5]

void ga::to_json ( ga::Json j,
const ga::vec3 &  v 
)
inline

◆ to_json() [5/5]

void ga::to_json ( ga::Json j,
const ga::vec4 &  v 
)
inline

◆ toDegrees() [1/2]

double ga::toDegrees ( const double &  radians)
inline

◆ toDegrees() [2/2]

template<typename T >
T ga::toDegrees ( const T &  radians)
inline

◆ toLower()

std::string ga::toLower ( std::string  str)
inline

◆ toRadians() [1/2]

double ga::toRadians ( const double &  degrees)
inline

◆ toRadians() [2/2]

template<typename T >
T ga::toRadians ( const T &  degrees)
inline

◆ toUpper()

std::string ga::toUpper ( std::string  str)
inline