Gamedev Framework (gf)
0.5.0
A C++11 framework for 2D games
|
All the classes related to game systems and game entities. More...
Classes | |
class | gf::ValueActivity |
An activity for a simple float value. More... | |
class | gf::RotateToActivity |
An activity for a change of angle. More... | |
class | gf::MoveToActivity |
An activity for a change of position. More... | |
class | gf::ColorActivity |
An activity for a change of color. More... | |
class | gf::CallbackActivity |
An activity for calling a function once. More... | |
class | gf::DelayActivity |
An activity to wait for a predefined duration. More... | |
class | gf::SequenceActivity |
An activity to run several activities sequentially. More... | |
class | gf::RepeatActivity |
An activity to run an activity several times. More... | |
class | gf::ParallelActivity |
An activity to run several activities in parallel. More... | |
class | gf::Activity |
A game activity. More... | |
class | gf::AssetManager |
An asset manager. More... | |
struct | gf::Penetration |
Data about the collision between two objects. More... | |
class | gf::Entity |
A game entity. More... | |
class | gf::EntityContainer |
A collection of entities. More... | |
class | gf::Bresenham |
State for the Bresenham's line algorithm. More... | |
struct | gf::Message |
The base class for all messages. More... | |
class | gf::MessageManager |
A message manager. More... | |
class | gf::Model |
A game object that can be updated. More... | |
class | gf::ModelContainer |
A collection of models. More... | |
class | gf::FixedTimestepModel |
Fixed timestep model. More... | |
class | gf::PhysicsBody |
A physics body. More... | |
class | gf::PhysicsGeometry |
The geometry of a physics body. More... | |
class | gf::PhysicsModel |
A model for physics simulation. More... | |
class | gf::ResourceCache< T > |
A generic cache for resources. More... | |
class | gf::ResourceManager |
A resource manager. More... | |
class | gf::TextureAtlas |
A collection of sub-texture. More... | |
class | gf::Tween< T > |
An interpolation between two values. More... | |
Typedefs | |
using | gf::MessageHandler = std::function< MessageStatus(Id, Message *)> |
A message handler. More... | |
using | gf::MessageHandlerId = uint64_t |
An identifier for a message handler. More... | |
Enumerations | |
enum | gf::ActivityStatus { gf::ActivityStatus::Running, gf::ActivityStatus::Finished } |
Status of an activity. More... | |
enum | gf::MessageStatus { gf::MessageStatus::Keep, gf::MessageStatus::Die } |
A message status. More... | |
Functions | |
std::vector< Vector2i > | gf::generateLine (Vector2i p0, Vector2i p1) |
Generate a line between two positions. More... | |
std::vector< Vector2f > | gf::midpointDisplacement1D (Vector2f p0, Vector2f p1, Random &random, unsigned iterations, Vector2f direction, float initialFactor=1.0f, float reductionFactor=0.5f) |
1D midpoint displacement More... | |
std::vector< Vector2f > | gf::midpointDisplacement1D (Vector2f p0, Vector2f p1, Random &random, unsigned iterations, float initialFactor=1.0f, float reductionFactor=0.5f) |
1D midpoint displacement More... | |
All the classes related to game systems and game entities.
using gf::MessageHandler = typedef std::function<MessageStatus(Id, Message *)> |
A message handler.
gf::MessageHandler is a function that can be called when a message is sent in a message handler. It can be a free function:
It can also be a member function (which is, in fact, the most probable use case).
using gf::MessageHandlerId = typedef uint64_t |
An identifier for a message handler.
|
strong |
Status of an activity.
Enumerator | |
---|---|
Running | The activity is still running. |
Finished | The activity is finished. |
|
strong |
A message status.
gf::MessageStatus indicates if a handler should be kept by the message manager or can be removed so that it will not receive any more messages.
Enumerator | |
---|---|
Keep | The handler must be kept |
Die | The handler can be removed |
Generate a line between two positions.
This function uses Bresenham's line algorithm.
p0 | The first point of the line |
p1 | The last point of the line |
std::vector<Vector2f> gf::midpointDisplacement1D | ( | Vector2f | p0, |
Vector2f | p1, | ||
Random & | random, | ||
unsigned | iterations, | ||
Vector2f | direction, | ||
float | initialFactor = 1.0f , |
||
float | reductionFactor = 0.5f |
||
) |
1D midpoint displacement
p0 | The first end point |
p1 | The second end point |
random | A random engine |
iterations | The number of iterations |
direction | The direction to make a displacement |
initialFactor | The initial factor to apply to the displacement |
reductionFactor | The factor to apply at each iteration |
std::vector<Vector2f> gf::midpointDisplacement1D | ( | Vector2f | p0, |
Vector2f | p1, | ||
Random & | random, | ||
unsigned | iterations, | ||
float | initialFactor = 1.0f , |
||
float | reductionFactor = 0.5f |
||
) |
1D midpoint displacement
The direction is perpendicular to the segment \( [P_0 P_1] \)
p0 | The first end point |
p1 | The second end point |
random | A random engine |
iterations | The number of iterations |
initialFactor | The initial factor to apply to the displacement |
reductionFactor | The factor to apply at each iteration |