CUGL
Cornell University Game Library
Classes | Typedefs | Enumerations | Functions
cugl Namespace Reference

Classes

class  AccelerationEvent
 
class  Accelerometer
 
class  Affine2
 
class  AnimationNode
 
class  Application
 
class  Asset
 
class  AssetManager
 
class  AudioEngine
 
class  BaseLoader
 
class  BinaryReader
 
class  BinaryWriter
 
class  BoxObstacle
 
class  Button
 
class  ButtonState
 
class  Camera
 
class  CapsuleObstacle
 
class  Color4
 
class  Color4f
 
class  ComplexObstacle
 
class  CubicSpline
 
class  CubicSplineApproximator
 
class  Display
 
class  Font
 
class  FontLoader
 
class  FreeList
 
class  Frustum
 
class  GenericLoader
 
class  GestureEvent
 
class  GestureInput
 
class  GreedyFreeList
 
class  Input
 
class  InputDevice
 
class  JsonLoader
 
class  JsonReader
 
class  JsonValue
 
class  JsonWriter
 
class  Keyboard
 
struct  KeyCodeHasher
 
class  KeyEvent
 
class  Label
 
class  Loader
 
class  Mat4
 
class  Mouse
 
class  MouseEvent
 
class  MouseWheelEvent
 
class  Music
 
class  MusicLoader
 
class  Node
 
class  Obstacle
 
class  ObstacleSelector
 
class  ObstacleWorld
 
class  OrthographicCamera
 
class  PanEvent
 
class  PanInput
 
class  PathExtruder
 
class  Pathname
 
class  PathNode
 
class  PathOutliner
 
class  PerspectiveCamera
 
class  PinchEvent
 
class  PinchInput
 
class  Plane
 
class  Poly2
 
class  PolygonNode
 
class  PolygonObstacle
 
class  Polynomial
 
class  ProgressBar
 
class  Quaternion
 
class  Ray
 
class  Rect
 
class  RotationEvent
 
class  RotationInput
 
class  Scene
 
struct  scheduable
 
class  Shader
 
class  SimpleObstacle
 
class  SimpleTriangulator
 
class  Size
 
class  Sound
 
class  SoundLoader
 
class  SpriteBatch
 
class  SpriteShader
 
class  TextInput
 
class  TextInputEvent
 
class  TextReader
 
class  Texture
 
class  TexturedNode
 
class  TextureLoader
 
class  TextWriter
 
class  ThreadPool
 
class  Timestamp
 
class  TouchEvent
 
class  Touchscreen
 
class  Vec2
 
class  Vec3
 
class  Vec4
 
class  Vertex2
 
class  Vertex3
 
class  WheelObstacle
 
class  WireNode
 

Typedefs

typedef std::function< void(const std::string &name, bool down)> ButtonListener
 
typedef std::function< void(const std::string &key, bool success)> LoaderCallback
 
typedef std::function< void(const AccelerationEvent &event, bool focus)> AccelerationListener
 
typedef std::function< void(const KeyEvent &event, bool focus)> KeyListener
 
typedef std::function< void(const MouseEvent &event, Uint8 clicks, bool focus)> MouseButtonListener
 
typedef std::function< void(const MouseEvent &event, const Vec2 &previous, bool focus)> MouseMotionListener
 
typedef std::function< void(const MouseWheelEvent &event, bool focus)> MouseWheelListener
 
typedef std::function< void(const TextInputEvent &event, bool focus)> TextInputListener
 
typedef std::function< bool(const std::string &value)> TextInputValidator
 
typedef Sint64 TouchID
 
typedef std::function< void(const TouchEvent &event, bool focus)> TouchListener
 
typedef std::function< void(const TouchEvent &event, const Vec2 &previous, bool focus)> TouchMotionListener
 
typedef std::function< void(const GestureEvent &event, bool focus)> GestureListener
 
typedef std::function< void(GestureState ostate, GestureState nstate)> GestureStateListener
 
typedef std::function< void(const PanEvent &event, bool focus)> PanListener
 
typedef std::function< void(const PinchEvent &event, bool focus)> PinchListener
 
typedef std::function< void(const RotationEvent &event, bool focus)> RotationListener
 
typedef Vec2 Point2
 
typedef Vec3 Point3
 

Enumerations

enum  KeyCode : int {
  KeyCode::NUM_0 = SDLK_0, KeyCode::NUM_1 = SDLK_1, KeyCode::NUM_2 = SDLK_2, KeyCode::NUM_3 = SDLK_3,
  KeyCode::NUM_4 = SDLK_4, KeyCode::NUM_5 = SDLK_5, KeyCode::NUM_6 = SDLK_6, KeyCode::NUM_7 = SDLK_7,
  KeyCode::NUM_8 = SDLK_8, KeyCode::NUM_9 = SDLK_9, KeyCode::A = SDLK_a, KeyCode::B = SDLK_b,
  KeyCode::C = SDLK_c, KeyCode::D = SDLK_d, KeyCode::E = SDLK_e, KeyCode::F = SDLK_f,
  KeyCode::G = SDLK_g, KeyCode::H = SDLK_h, KeyCode::I = SDLK_i, KeyCode::J = SDLK_j,
  KeyCode::K = SDLK_k, KeyCode::L = SDLK_l, KeyCode::M = SDLK_m, KeyCode::N = SDLK_n,
  KeyCode::O = SDLK_o, KeyCode::P = SDLK_p, KeyCode::Q = SDLK_q, KeyCode::R = SDLK_r,
  KeyCode::S = SDLK_s, KeyCode::T = SDLK_t, KeyCode::U = SDLK_u, KeyCode::V = SDLK_v,
  KeyCode::W = SDLK_w, KeyCode::X = SDLK_x, KeyCode::Y = SDLK_y, KeyCode::Z = SDLK_z,
  KeyCode::ARROW_DOWN = SDLK_DOWN, KeyCode::ARROW_LEFT = SDLK_LEFT, KeyCode::ARROW_RIGHT = SDLK_RIGHT, KeyCode::ARROW_UP = SDLK_UP,
  KeyCode::QUOTE = SDLK_QUOTE, KeyCode::BACKSLASH = SDLK_BACKSLASH, KeyCode::COMMA = SDLK_COMMA, KeyCode::EQUALS = SDLK_EQUALS,
  KeyCode::BACKQUOTE = SDLK_BACKQUOTE, KeyCode::LEFT_BRACKET = SDLK_LEFTBRACKET, KeyCode::MINUS = SDLK_MINUS, KeyCode::PERIOD = SDLK_PERIOD,
  KeyCode::RIGHT_BRACKET = SDLK_RIGHTBRACKET, KeyCode::SEMICOLON = SDLK_SEMICOLON, KeyCode::SLASH = SDLK_SLASH, KeyCode::BACKSPACE = SDLK_BACKSPACE,
  KeyCode::SPACE = SDLK_SPACE, KeyCode::TAB = SDLK_TAB, KeyCode::DEL = SDLK_DELETE, KeyCode::END = SDLK_END,
  KeyCode::ESCAPE = SDLK_ESCAPE, KeyCode::HOME = SDLK_HOME, KeyCode::HELP = SDLK_HELP, KeyCode::PAGE_DOWN = SDLK_PAGEDOWN,
  KeyCode::PAGE_UP = SDLK_PAGEUP, KeyCode::PAUSE = SDLK_PAUSE, KeyCode::RETURN = SDLK_RETURN, KeyCode::ENTER = SDLK_RETURN2,
  KeyCode::CAPS_LOCK = SDLK_CAPSLOCK, KeyCode::LEFT_ALT = SDLK_LALT, KeyCode::LEFT_CTRL = SDLK_LCTRL, KeyCode::LEFT_SHIFT = SDLK_LSHIFT,
  KeyCode::LEFT_META = SDLK_LGUI, KeyCode::RIGHT_ALT = SDLK_RALT, KeyCode::RIGHT_CTRL = SDLK_RCTRL, KeyCode::RIGHT_SHIFT = SDLK_RSHIFT,
  KeyCode::RIGHT_META = SDLK_RGUI, KeyCode::NUMLOCK = SDLK_NUMLOCKCLEAR, KeyCode::KEYPAD_0 = SDLK_KP_0, KeyCode::KEYPAD_1 = SDLK_KP_1,
  KeyCode::KEYPAD_2 = SDLK_KP_2, KeyCode::KEYPAD_3 = SDLK_KP_3, KeyCode::KEYPAD_4 = SDLK_KP_4, KeyCode::KEYPAD_5 = SDLK_KP_5,
  KeyCode::KEYPAD_6 = SDLK_KP_6, KeyCode::KEYPAD_7 = SDLK_KP_7, KeyCode::KEYPAD_8 = SDLK_KP_8, KeyCode::KEYPAD_9 = SDLK_KP_9,
  KeyCode::KEYPAD_CLEAR = SDLK_KP_CLEAR, KeyCode::KEYPAD_EQUALS = SDLK_KP_EQUALS, KeyCode::KEYPAD_DIVIDE = SDLK_KP_DIVIDE, KeyCode::KEYPAD_MULTIPLY = SDLK_KP_MULTIPLY,
  KeyCode::KEYPAD_MINUS = SDLK_KP_MINUS, KeyCode::KEYPAD_PLUS = SDLK_KP_PLUS, KeyCode::KEYPAD_ENTER = SDLK_KP_ENTER, KeyCode::UNKNOWN = SDLK_POWER
}
 
enum  KeyCategory {
  KeyCategory::NUMBER, KeyCategory::LETTER, KeyCategory::ARROW, KeyCategory::PUNCTUATION,
  KeyCategory::SPECIAL, KeyCategory::MODIFIER, KeyCategory::KEYPAD, KeyCategory::UNKNOWN
}
 
enum  GestureState : int {
  GestureState::UNDEFINED = 0, GestureState::MATCHING = 1, GestureState::PAUSED = 2, GestureState::RECORDING = 3,
  GestureState::ABORTING = 4, GestureState::LOADING = 5, GestureState::STORING = 6
}
 
enum  PathJoint : int { PathJoint::NONE = 0, PathJoint::MITRE = 1, PathJoint::BEVEL = 2, PathJoint::ROUND = 3 }
 
enum  PathCap : int { PathCap::NONE = 0, PathCap::SQUARE = 1, PathCap::ROUND = 2 }
 
enum  PathTraversal : int { PathTraversal::NONE = 0, PathTraversal::OPEN = 1, PathTraversal::CLOSED = 2, PathTraversal::INTERIOR = 3 }
 

Functions

int operator* (Font::Style value)
 
Font::Style operator| (Font::Style lhs, Font::Style rhs)
 
Font::Style operator& (Font::Style lhs, Font::Style rhs)
 
Font::Style operator^ (Font::Style lhs, Font::Style rhs)
 
Font::Style operator~ (Font::Style lhs)
 
SDL_FORCE_INLINE Uint16 marshall (Sint16 value)
 
SDL_FORCE_INLINE Uint16 marshall (Uint16 value)
 
SDL_FORCE_INLINE Uint32 marshall (Sint32 value)
 
SDL_FORCE_INLINE Uint32 marshall (Uint32 value)
 
SDL_FORCE_INLINE Uint64 marshall (Sint64 value)
 
SDL_FORCE_INLINE Uint64 marshall (Uint64 value)
 
SDL_FORCE_INLINE float marshall (float value)
 
SDL_FORCE_INLINE double marshall (double value)
 
Vec2operator*= (Vec2 &v, const Affine2 &m)
 
const Vec2 operator* (const Vec2 &v, const Affine2 &m)
 
const Affine2 operator* (float scalar, const Affine2 &m)
 
const Color4f operator* (float s, const Color4f &c)
 
const Color4 operator* (float s, Color4 c)
 
Vec2operator*= (Vec2 &v, const Mat4 &m)
 
const Vec2 operator* (const Vec2 &v, const Mat4 &m)
 
Vec3operator*= (Vec3 &v, const Mat4 &m)
 
const Vec3 operator* (const Vec3 &v, const Mat4 &m)
 
Vec4operator*= (Vec4 &v, const Mat4 &m)
 
const Vec4 operator* (const Vec4 &v, const Mat4 &m)
 
const Mat4 operator* (float scalar, const Mat4 &m)
 
Vec3operator*= (Vec3 &v, const Quaternion &quat)
 
const Vec3 operator* (const Vec3 &v, const Quaternion &quat)
 
const Quaternion operator* (float s, const Quaternion &quat)
 
const Vec2 operator* (float x, const Vec2 &v)
 
const Vec3 operator* (float x, const Vec3 &v)
 
const Vec4 operator* (float x, const Vec4 &v)
 
std::string to_string (Uint8 value)
 
std::string to_string (Sint16 value)
 
std::string to_string (Uint16 value)
 
std::string to_string (Sint32 value)
 
std::string to_string (Uint32 value)
 
std::string to_string (Sint64 value)
 
std::string to_string (Uint64 value)
 
std::string to_string (float value)
 
std::string to_string (double value)
 
std::string to_string (Uint8 *array, size_t length, size_t offset=0)
 
std::string to_string (Sint16 *array, size_t length, size_t offset=0)
 
std::string to_string (Uint16 *array, size_t length, size_t offset=0)
 
std::string to_string (Sint32 *array, size_t length, size_t offset=0)
 
std::string to_string (Uint32 *array, size_t length, size_t offset=0)
 
std::string to_string (Sint64 *array, size_t length, size_t offset=0)
 
std::string to_string (Uint64 *array, size_t length, size_t offset=0)
 
std::string to_string (float *array, size_t length, size_t offset=0)
 
std::string to_string (double *array, size_t length, size_t offset=0)
 
Uint8 stou8 (const std::string &str, std::size_t *pos=0, int base=10)
 
Sint16 stos16 (const std::string &str, std::size_t *pos=0, int base=10)
 
Uint16 stou16 (const std::string &str, std::size_t *pos=0, int base=10)
 
Sint32 stos32 (const std::string &str, std::size_t *pos=0, int base=10)
 
Uint32 stou32 (const std::string &str, std::size_t *pos=0, int base=10)
 
Sint64 stos64 (const std::string &str, std::size_t *pos=0, int base=10)
 
Uint64 stou64 (const std::string &str, std::size_t *pos=0, int base=10)
 
float stof (const std::string &str, std::size_t *pos=0)
 
double stod (const std::string &str, std::size_t *pos=0)
 

Detailed Description

Comment this out to use SDL sound on Mac/iOS (not recommended)

Typedef Documentation

This type represents a listener for the Accelerometer class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

An event is delivered whenever the accleration delta (the difference between the current and previous value) exceeds the device threshold. See the method Accelerometer#getThreshold() for more information.

Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

While accleration listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Acclerometer device.

The function type is equivalent to

 std::function<void(const std::string& value, Timestamp stamp, bool focus)>
Parameters
eventThe acceleration event
focusWhether the listener currently has focus

This type represents a listener for state change in the Button class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. For simplicity, Button nodes only support a single listener. If you wish for more than one listener, then your listener should handle its own dispatch.

The function type is equivalent to

 std::function<void(const std::string& name, bool down)>
Parameters
nameThe button name
clicksWhether the button is now down

This type represents a listener for a gesture in the GestureInput class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

While gesture listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the GestureInput device.

The function type is equivalent to

 std::function<void(const GestureEvent& event, bool focus)>
Parameters
eventThe touch event for this gesture event
focusWhether the listener currently has focus

This type represents a listener for a state change in the GestureInput class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

This type of listener responds to changes in the input device state. This is necessary because the GestureInput class cycles between many states and the state changes (such as from recording back to input matching) are asynchronous. As with all listeners, these functions guaranteed to be called at the start of an animation frame, before the method Application#update(float).

While state listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the GestureInput device.

The function type is equivalent to

 std::function<void(GestureInput::State ostate, GestureInput::State nstate)>
Parameters
ostateThe old input state
nstateThe new input state

This type represents a listener for the Keyboard class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

A Keyboard is designed to send input to a focused object (e.g. a text field or other UI widget). While only one listener can have focus at a time, all listeners will receive input from the Keyboard.

Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

The function type is equivalent to

 std::function<void(const KeyEvent& event, bool focus)>
Parameters
codeThe code for this key
stampThe timestamp for this event
focusWhether the listener currently has focus

This type represents a callback for asynchronous asset loading

This callback is associated with an asset at the time of the asychronous load request. When the asset either loads, or fails to load, this callback is called with the asset status.

In the case of JSON asset directories, a single callback may be associated with several assets. In that case, the callback funtion is called each time that an asset loads or fails to load. If an entire node in the asset directory fails to load, the callback function will be notified using the key for that JSON node.

The function type is equivalent to

 std::function<void(const std::string& key, bool success)>
Parameters
keyThe key to associate with the asset (or asset category)
successWhether the asset was successfully loaded

This type represents a listener for button presses/releases in the Mouse class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

This type of listener only responds to button presses and releases, not mouse movement. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

The listener does not receive any information indicating whether the event is a press or a release. That is handled when the listener is registered. On the other hand, the listener will get a counter if the press/release is a sequence of rapid clicks. This is a way of detecting double or even triple clicks. The click counter will continue to increment as long as there is a click every .5 seconds.

While mouse listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Mouse device.

The function type is equivalent to

 std::function<void(const MouseEvent& event, Uint8 clicks, bool focus)>
Parameters
eventThe mouse event for this press/release
clicksThe number of recent clicks, including this one
focusWhether the listener currently has focus

This type represents a listener for movement in the Mouse class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

This type of listener only responds to mouse movement, not button presses or releases. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

In addition the the mouse event, the listener will provide the previously registered mouse location. This will allow you to determin the relative mouse movement.

While mouse listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Mouse device.

The function type is equivalent to

 std::function<void(const MouseEvent& event, const Vec2& previous, bool focus)>
Parameters
eventThe mouse event for this movement
previousThe previous position of the mouse
focusWhether the listener currently has focus

This type represents a listener for the mouse wheel in the Mouse class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

This type of listener only responds to the wheel mouse, not any other buttons or mouse movement. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

While mouse listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Mouse device.

The function type is equivalent to

 std::function<void(const MouseWheelEvent& event, bool focus)>
Parameters
eventThe mouse event for this wheel motion
focusWhether the listener currently has focus

This type represents a listener for a pan in the PanInput class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

While pan listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the PanInput device.

The function type is equivalent to

 std::function<void(const PanEvent& event, bool focus)>
Parameters
eventThe touch event for this pan event
focusWhether the listener currently has focus

This type represents a listener for a pinch/zoom in the PinchInput class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

While pinch listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the PinchInput device.

The function type is equivalent to

 std::function<void(const PinchEvent& event, bool focus)>
Parameters
eventThe touch event for this pinch/zoom
focusWhether the listener currently has focus
typedef Vec2 cugl::Point2

Provide an alternative name for Vec2

typedef Vec3 cugl::Point3

Provide an alternative name for Vec3

This type represents a listener for a rotation in the RotationInput class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

While rotation listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the RotationInput device.

The function type is equivalent to

 std::function<void(const RotationInput& event, bool focus)>
Parameters
eventThe touch event for this pinch/zoom
focusWhether the listener currently has focus

This type represents a listener for the TextInput class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

A TextInput is designed to send input to a focused object (e.g. a text field or other UI widget). While only one listener can have focus at a time, all listeners will receive input from the TextInput.

This listener is called whenever text is appends to the buffer. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

The function type is equivalent to

 std::function<void(const TextInputEvent& event, bool focus)>
Parameters
eventThe input event for this append to the buffer
focusWhether the listener currently has focus

This type represents a listener for validating text input. A validator checks whether intermediate input should be appended to the buffer. There may only be one validator at a time.

This function type is equivalent to

 std::function<bool(const std::string& value)>
Parameters
valueThe character or string to append to the buffer
Returns
true if the value should be appended to the buffer
typedef Sint64 cugl::TouchID

This is the type representing a finger or touch

This type represents a listener for a press/release in the Touchscreen class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

This type of listener only responds to button presses and releases, not touch movement. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

The listener does not receive any information indicating whether the event is a press or a release. That is handled when the listener is registered.

While touch listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Touchscreen device.

The function type is equivalent to

 std::function<void(const TouchEvent& event, bool focus)>
Parameters
eventThe touch event for this press/release
focusWhether the listener currently has focus

This type represents a listener for movement in the Touchscreen class.

In CUGL, listeners are implemented as a set of callback functions, not as objects. This allows each listener to implement as much or as little functionality as it wants. A listener is identified by a key which should be a globally unique unsigned int.

This type of listener only responds to touch movement, not presses or releases. Listeners are guaranteed to be called at the start of an animation frame, before the method Application#update(float).

In addition the the touch event, the listener will provide the previously registered touch location. This will allow you to determin the relative touch movement.

While touch listeners do not traditionally require focus like a keyboard does, we have included that functionality. While only one listener can have focus at a time, all listeners will receive input from the Touchscreen device.

The function type is equivalent to

 std::function<void(const TouchEvent& event, const Vec2& previous, bool focus)>
Parameters
eventThe touch event for this movement
previousThe previous position of the touch
focusWhether the listener currently has focus

Enumeration Type Documentation

enum cugl::GestureState : int
strong

This enum represents the current state of the gesture input device

Unlike most other input devices, this device can be in several different states as it cycles between recording and template matching. Gesture events will only be generated during the MATCHING state

Enumerator
UNDEFINED 

The input device is uninitialized.

This is the state of the input device if there is no attached touch device for receiving gestures. Because of an unusual design decision in SDL, some touch devices are not recognized until the user touches for the first time. Hence it is possible that the input device may change from this state to another state.

MATCHING 

The input device is matching gestures to templates.

This is the default state of the device. When it this state, the device is actively matching against any defined dollar templates.

PAUSED 

The input device is paused.

In this state, the input device is not matching against any dollar templates. The templates are not erased (as in the case when the device is deactivated), but the matching overhead is not incurred.

RECORDING 

The input device is recording a gesture.

In this state, the input device will record the next gesture on the device. This gesture will start from the next finger down and last until the finger is removed. Adding any fingers will stop the recording as well.

ABORTING 

The input device is aborting a recorded gesture.

If you abort a recorded gesture, you must wait until the recording is complete. This state will wait until it is complete and perform any necessary clean-up.

LOADING 

The input device is loading gestures from a file.

The input device will block until the file is fully loading.

STORING 

The input device is storing gestures to a file.

The input device will block until the file has been written.

enum cugl::KeyCategory
strong

This enum represents the category of the key

Categories are used to group key codes in rough groups

Enumerator
NUMBER 

This key code is a number 0 to 9

LETTER 

This key code is letter in the roman alphabet

ARROW 

This key code is an arrow key

PUNCTUATION 

This key code is a punctuation (or space) marker

SPECIAL 

This key code is a special character, including return or enter

MODIFIER 

This key code is a modier like shift or control

KEYPAD 

This key code is a character from the keypad

UNKNOWN 

This key code is not supported by CUGL

enum cugl::KeyCode : int
strong

This is enum represents a key on a keyboard.

The keys available are subset of the full range of available keys. Because of our goal of cross-platform support, we only support keys that are found on most common keyboards.

The Input dispatcher will convert from an SDL keycode this enum. That means it is possible to receive a KeyCode that is not present in the enum. Any switch statement for this enum should have a default value.

Enumerator
NUM_0 

The 0 key

NUM_1 

The 1 key

NUM_2 

The 2 key

NUM_3 

The 3 key

NUM_4 

The 4 key

NUM_5 

The 5 key

NUM_6 

The 6 key

NUM_7 

The 7 key

NUM_8 

The 8 key

NUM_9 

The 9 key

The A key

The B key

The C key

The D key

The E key

The F key

The G key

The H key

The I key

The J key

The K key

The L key

The M key

The N key

The O key

The P key

The Q key

The R key

The S key

The T key

The U key

The V key

The W key

The X key

The Y key

The Z key

ARROW_DOWN 

The down arrow key

ARROW_LEFT 

The Left arrow key

ARROW_RIGHT 

The right arrow key

ARROW_UP 

The up arrow key

QUOTE 

The ' (apostrophe) key

BACKSLASH 

The \ (backslash) key

COMMA 

The , (comma) key

EQUALS 

The = (equals) key

BACKQUOTE 

The ` (grave accent) key

LEFT_BRACKET 

The [ (left bracket) ley

MINUS 

The - (minus) key

PERIOD 

The . (period) key

RIGHT_BRACKET 

The ] (right bracket) key

SEMICOLON 

The ; (semicolon) key

SLASH 

The / (slash) key

BACKSPACE 

The backspace key

SPACE 

The spacebar

TAB 

The tab key

DEL 

The Delete key

END 

The End key

ESCAPE 

The Esc key

HOME 

The Home key

HELP 

The Help key

PAGE_DOWN 

The PageDown key

PAGE_UP 

The PageUp key

PAUSE 

The Pause/Break key

RETURN 

The Return key

ENTER 

The Enter key

CAPS_LOCK 

The Caps Lock key

LEFT_ALT 

The left Alt/Option key

LEFT_CTRL 

The left Ctrl key

LEFT_SHIFT 

The left Shift key

LEFT_META 

The left Windows/Apple/Meta key

RIGHT_ALT 

The right Alt/Option key

RIGHT_CTRL 

The right Ctrl key

RIGHT_SHIFT 

The right Shift key

RIGHT_META 

The right Windows/Apple/Meta key

NUMLOCK 

The Numlock/Clear key

KEYPAD_0 

Tthe 0 key (numeric keypad)

KEYPAD_1 

The 1 key (numeric keypad)

KEYPAD_2 

The 2 key (numeric keypad)

KEYPAD_3 

The 3 key (numeric keypad)

KEYPAD_4 

The 4 key (numeric keypad)

KEYPAD_5 

The 5 key (numeric keypad)

KEYPAD_6 

The 6 key (numeric keypad)

KEYPAD_7 

The 7 key (numeric keypad)

KEYPAD_8 

The 8 key (numeric keypad)

KEYPAD_9 

The 9 key (numeric keypad)

KEYPAD_CLEAR 

The Clear key (numeric keypad)

KEYPAD_EQUALS 

The = [equals] key (numeric keypad)

KEYPAD_DIVIDE 

The / [divide] key (numeric keypad)

KEYPAD_MULTIPLY 

The * [multiply] key (numeric keypad)

KEYPAD_MINUS 

The - [minus] key (numeric keypad)

KEYPAD_PLUS 

The + [plus] key (numeric keypad)

KEYPAD_ENTER 

The Enter key (numeric keypad)

UNKNOWN 

We have no idea what this key is

enum cugl::PathCap : int
strong

The types of caps supported in an extrusion.

A cap is the rule for how to end an extruded line segment that has no neighbor on that end. If there is no cap, the path terminates at the end vertices.

This enumeration is used by both PathExtruder and PathNode.

Enumerator
NONE 

No end cap; the path terminates at the end vertices

SQUARE 

Square cap; like no cap, except the ends are padded by stroke width

ROUND 

Round cap; the ends are half circles whose radius is the stroke width

enum cugl::PathJoint : int
strong

The types of joints supported in an extrusion.

A joint is the rule for how to connect two extruded line segments. If there is not joint, the path will look like a sequence of overlapping rectangles.

This enumeration is used by both PathExtruder and PathNode.

Enumerator
NONE 

No joint; the path will look like a sequence of links

MITRE 

Mitre joint; ideal for paths with sharp corners

BEVEL 

Bevel joint; ideal for smoother paths

ROUND 

Round joint; used to smooth out paths with sharp corners

enum cugl::PathTraversal : int
strong

This enum lists the types of path traversal that are supported.

This enumeration is used by both PathOutliner and WireNode.

Enumerator
NONE 

No traversal; the index list will be empty.

OPEN 

Traverse the border, but do not close the ends.

CLOSED 

Traverse the border, and close the ends.

INTERIOR 

Traverse the individual triangles in the standard tesselation.

Function Documentation

SDL_FORCE_INLINE Uint16 cugl::marshall ( Sint16  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE Uint16 cugl::marshall ( Uint16  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE Uint32 cugl::marshall ( Sint32  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE Uint32 cugl::marshall ( Uint32  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE Uint64 cugl::marshall ( Sint64  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE Uint64 cugl::marshall ( Uint64  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE float cugl::marshall ( float  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
SDL_FORCE_INLINE double cugl::marshall ( double  value)

Returns the given value encoded in network order

On a big-endian system, this function has no effect. On a little-endian system, it swaps the bytes to put them in big-endian order.

This function is idempotent. To decode an encoded value, call this function on the value again.

Parameters
valueThe value to encode
Returns
the given value encoded in network order
Font::Style cugl::operator& ( Font::Style  lhs,
Font::Style  rhs 
)
inline

Returns the bitwise and of two font styles.

Returns
the bitwise and of two font styles.
const Vec2 cugl::operator* ( const Vec2 v,
const Affine2 m 
)
inline

Returns a copy of the vector after it is transformed.

Parameters
vThe point to transform.
mThe transform to apply.
Returns
a copy of the vector after it is transformed.
const Affine2 cugl::operator* ( float  scalar,
const Affine2 m 
)
inline

Multiplies the components of the given matrix by the specified scalar.

The scalar is applied to BOTH the core matrix and the offset.

Parameters
scalarThe scalar value.
mThe transform to scale.
Returns
a copy of the scaled transform
const Vec3 cugl::operator* ( const Vec3 v,
const Quaternion quat 
)
inline

Returns a copy of the vector rotated by the quaternion.

The rotation is defined by the matrix associated with the vector. As per the convention for Mat4, we only allow vectors to be multiplied on the right by quaternions.

Parameters
vThe vector to rotate.
quatThe rotation quaternion.
Returns
a copy of the vector rotated by the quaternion.
const Quaternion cugl::operator* ( float  s,
const Quaternion quat 
)
inline

Returns the scalar product of the quaternion with the given value.

Parameters
sThe value to scale by.
quatThe quaternion to scale.
Returns
The scalar product of this quaternion with the given value.
const Vec3 cugl::operator* ( float  x,
const Vec3 v 
)
inline

Returns the scalar product of the given vector with the given value.

Parameters
xThe value to scale by.
vThe vector to scale.
Returns
The scaled vector.
int cugl::operator* ( Font::Style  value)
inline

Returns the int equivalent of a font style.

Returns
the int equivalent of a font style.
const Vec4 cugl::operator* ( float  x,
const Vec4 v 
)
inline

Returns the scalar product of the given vector with the given value.

Parameters
xThe value to scale by.
vThe vector to scale.
Returns
The scaled vector.
const Vec2 cugl::operator* ( float  x,
const Vec2 v 
)
inline

Returns the scalar product of the given vector with the given value.

Parameters
xThe value to scale by.
vThe vector to scale.
Returns
The scaled vector.
const Vec2 cugl::operator* ( const Vec2 v,
const Mat4 m 
)
inline

Returns a copy of the vector transformed by the given matrix.

The vector is treated as a point, which means that translation is applied to the result.

Parameters
vThe point to transform.
mThe matrix to transform by.
Returns
a copy of the vector transformed by the given matrix.
const Vec3 cugl::operator* ( const Vec3 v,
const Mat4 m 
)
inline

Returns a copy of the vector transformed by the given matrix.

The vector is treated as a point, which means that translation is applied to the result.

Parameters
vThe point to transform.
mThe matrix to transform by.
Returns
a copy of the vector transformed by the given matrix.
const Vec4 cugl::operator* ( const Vec4 v,
const Mat4 m 
)
inline

Returns a copy of the vector transformed by the given matrix.

The vector is treated as is. Hence whether or not translation is applied depends on the value of w.

Parameters
vThe point to transform.
mThe matrix to transform by.
Returns
a copy of the vector transformed by the given matrix.
const Mat4 cugl::operator* ( float  scalar,
const Mat4 m 
)
inline

Multiplies the components of the given matrix by the specified scalar.

Parameters
scalarThe scalar value.
mThe matrix to transform by.
Returns
a copy of the scaled matrix
const Color4f cugl::operator* ( float  s,
const Color4f c 
)
inline

Returns the scalar product of the given color with the given value.

The scaling is clamped so that this remains a valid color.

This version of scaling always multiplies the alpha values.

Parameters
sThe value to scale by.
cThe color to scale.
Returns
The scaled color.
const Color4 cugl::operator* ( float  s,
Color4  c 
)
inline

Returns the scalar product of the given color with the given value.

The scaling is clamped so that this remains a valid color.

This version of scaling always multiplies the alpha values.

Parameters
sThe value to scale by.
cThe color to scale.
Returns
The scaled color.
Vec2& cugl::operator*= ( Vec2 v,
const Affine2 m 
)
inline

Transforms the given point in place.

Parameters
vThe point to transform.
mThe transform to apply.
Returns
this point, after the transformation occurs.
Vec3& cugl::operator*= ( Vec3 v,
const Quaternion quat 
)
inline

Rotates the vector in place by the quaternion.

The rotation is defined by the matrix associated with the vector. As per the convention for Mat4, we only allow vectors to be multiplied on the right by quaternions.

Parameters
vThe vector to rotate.
quatThe rotation quaternion.
Returns
a reference to the vector, after rotation.
Vec2& cugl::operator*= ( Vec2 v,
const Mat4 m 
)
inline

Transforms the given point by the given matrix.

The vector is treated as a point, which means that translation is applied to the result.

Parameters
vThe point to transform.
mThe matrix to transform by.
Returns
this point, after the transformation occurs.
Vec3& cugl::operator*= ( Vec3 v,
const Mat4 m 
)
inline

Transforms the given point by the given matrix.

The vector is treated as a point, which means that translation is applied to the result.

Parameters
vThe point to transform.
mThe matrix to transform by.
Returns
this point, after the transformation occurs.
Vec4& cugl::operator*= ( Vec4 v,
const Mat4 m 
)
inline

Transforms the given point by the given matrix.

The vector is treated as is. Hence whether or not translation is applied depends on the value of w.

Parameters
vThe point to transform.
mThe matrix to transform by.
Returns
this point, after the transformation occurs.
Font::Style cugl::operator^ ( Font::Style  lhs,
Font::Style  rhs 
)
inline

Returns the bitwise exclusive or of two font styles.

Returns
the bitwise exclusive or of two font styles.
Font::Style cugl::operator| ( Font::Style  lhs,
Font::Style  rhs 
)
inline

Returns the bitwise or of two font styles.

Returns
the bitwise or of two font styles.
Font::Style cugl::operator~ ( Font::Style  lhs)
inline

Returns the bitwise complement of a font style.

Returns
the bitwise complement of a font style.
double cugl::stod ( const std::string &  str,
std::size_t *  pos = 0 
)

Returns the double equivalent to the given string

This function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating point representation and converts them to a floating point value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
Returns
the double equivalent to the given string
float cugl::stof ( const std::string &  str,
std::size_t *  pos = 0 
)

Returns the float equivalent to the given string

This function discards any whitespace characters (as determined by std::isspace()) until first non-whitespace character is found. Then it takes as many characters as possible to form a valid floating point representation and converts them to a floating point value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
Returns
the float equivalent to the given string
Sint16 cugl::stos16 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the signed 16 bit integer equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the signed 16 bit integer equivalent to the given string
Sint32 cugl::stos32 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the signed 32 bit integer equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the signed 32 bit integer equivalent to the given string
Sint64 cugl::stos64 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the signed 64 bit integer equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the signed 64 bit integer equivalent to the given string
Uint16 cugl::stou16 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the unsigned 16 bit integer equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the unsigned 16 bit integer equivalent to the given string
Uint32 cugl::stou32 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the unsigned 32 bit integer equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the unsigned 32 bit integer equivalent to the given string
Uint64 cugl::stou64 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the unsigned 64 bit integer equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to a long value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the unsigned 64 bit integer equivalent to the given string
Uint8 cugl::stou8 ( const std::string &  str,
std::size_t *  pos = 0,
int  base = 10 
)

Returns the byte equivalent to the given string

This function discards any whitespace characters (as identified by calling isspace()) until the first non-whitespace character is found, then takes as many characters as possible to form a valid base-n (where n=base) integer number representation and converts them to an integer value.

Parameters
strthe string to convert
posaddress of an integer to store the number of characters processed
basethe number base
Returns
the byte equivalent to the given string
std::string cugl::to_string ( Uint8  value)

Returns a string equivalent to the given byte

The value is displayed as a number, not a character.

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given byte
std::string cugl::to_string ( Sint16  value)

Returns a string equivalent to the given signed 16 bit integer

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given signed 16 bit integer
std::string cugl::to_string ( Uint16  value)

Returns a string equivalent to the given unsigned 16 bit integer

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given unsigned 16 bit integer
std::string cugl::to_string ( Sint32  value)

Returns a string equivalent to the given signed 32 bit integer

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given signed 32 bit integer
std::string cugl::to_string ( Uint32  value)

Returns a string equivalent to the given unsigned 32 bit integer

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given unsigned 32 bit integer
std::string cugl::to_string ( Sint64  value)

Returns a string equivalent to the given signed 64 bit integer

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given signed 64 bit integer
std::string cugl::to_string ( Uint64  value)

Returns a string equivalent to the given unsigned 64 bit integer

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given unsigned 64 bit integer
std::string cugl::to_string ( float  value)

Returns a string equivalent to the given float value

The precision is the same as std::to_string(float).

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given float value
std::string cugl::to_string ( double  value)

Returns a string equivalent to the given double value

The precision is the same as std::to_string(double).

Parameters
valuethe numeric value to convert
Returns
a string equivalent to the given double value
std::string cugl::to_string ( Uint8 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the given byte array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the given byte array
std::string cugl::to_string ( Sint16 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the signed 16 bit integer array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the signed 16 bit integer array
std::string cugl::to_string ( Uint16 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the unsigned 16 bit integer array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the unsigned 16 bit integer array
std::string cugl::to_string ( Sint32 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the signed 32 bit integer array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the signed 32 bit integer array
std::string cugl::to_string ( Uint32 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the unsigned 32 bit integer array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the unsigned 32 bit integer array
std::string cugl::to_string ( Sint64 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the signed 64 bit integer array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the signed 64 bit integer array
std::string cugl::to_string ( Uint64 *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the unsigned 64 bit integer array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the unsigned 64 bit integer array
std::string cugl::to_string ( float *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the given float array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the given float array
std::string cugl::to_string ( double *  array,
size_t  length,
size_t  offset = 0 
)

Returns a string equivalent to the given double array

The value is display as a python-style list in brackets.

Parameters
arraythe array to convert
lengththe array length
offsetthe starting position in the array
Returns
a string equivalent to the given double array