Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Classes | Typedefs | Enumerations | Functions | Variables
Graphics classes

All the classes related to graphics. More...

Classes

class  gf::AnimatedSprite
 An animated sprite. More...
 
class  gf::Animation
 An animation. More...
 
struct  gf::BlendMode
 Blending modes for drawing. More...
 
class  gf::BufferedGeometry
 A drawable for buffers. More...
 
struct  gf::Color
 Predefined colors. More...
 
struct  gf::ColorRamp
 A color ramp. More...
 
class  gf::Curve
 A curve is a one dimension object. More...
 
class  gf::Drawable
 Abstract base class for objects that can be drawn to a render window. More...
 
class  gf::Effect
 A post-processing effect. More...
 
class  gf::DefaultEffect
 Default effect. More...
 
class  gf::AntiAliasingEffect
 Anti-aliasing effect. More...
 
class  gf::ColorMatrixEffect
 Generic color matrix effect. More...
 
class  gf::ColorEffect
 Simple color effects. More...
 
class  gf::ColorBlindEffect
 Simulation of color blindness. More...
 
class  gf::EdgeEffect
 Edge detector. More...
 
struct  gf::Glyph
 A glyph. More...
 
class  gf::Font
 A character font. More...
 
class  gf::Image
 Class for loading, manipulating and saving images. More...
 
class  gf::NinePatch
 A nine-patch. More...
 
class  gf::PostProcessing
 A post-processing drawable. More...
 
class  gf::RenderPipeline
 A render pipeline. More...
 
struct  gf::RenderStates
 Define the states used for drawing to a RenderTarget. More...
 
class  gf::RenderTarget
 Base class for all render targets (window, texture, ...) More...
 
class  gf::RenderTexture
 Target for off-screen 2D rendering into a texture. More...
 
class  gf::RenderWindow
 A window that can serve as a target for 2D drawing. More...
 
class  gf::Shader
 An OpenGL vertex and/or fragment shader. More...
 
class  gf::Shape
 Base class for textured shapes with outline. More...
 
class  gf::RectangleShape
 Specialized shape representing a rectangle. More...
 
class  gf::CircleShape
 Specialized shape representing a circle. More...
 
class  gf::ConvexShape
 Specialized shape representing a convex polygon. More...
 
class  gf::StarShape
 Specialized shape representing a star. More...
 
class  gf::RoundedRectangleShape
 Specialized shape representing a rounded rectangle. More...
 
class  gf::Sprite
 A drawable representation of a texture, with its own transformations, color, etc. More...
 
class  gf::SpriteBatch
 A sprite batch. More...
 
class  gf::Text
 Graphical text that can be drawn to a render target. More...
 
class  gf::BareTexture
 An image that lives in the graphic memory that can be used for drawing. More...
 
class  gf::Texture
 A texture for colored images. More...
 
class  gf::AlphaTexture
 A texture with a single alpha channel. More...
 
class  gf::TileLayer
 A tile layer. More...
 
class  gf::Transformable
 Decomposed transform defined by a position, a rotation and a scale. More...
 
class  gf::UI
 Context for an immediate mode graphical interface. More...
 
struct  gf::Vertex
 A point associated with a color and a texture coordinate. More...
 
class  gf::VertexArray
 A set of primitives. More...
 
class  gf::VertexBuffer
 Data in the graphics memory. More...
 
class  gf::View
 2D camera that defines what region is shown on screen More...
 
class  gf::AdaptativeView
 Adaptative view. More...
 
class  gf::ViewContainer
 A container of views. More...
 
class  gf::StretchView
 Stretch view. More...
 
class  gf::FitView
 Fit view. More...
 
class  gf::FillView
 Fill view. More...
 
class  gf::ExtendView
 Extend view. More...
 
class  gf::ScreenView
 Screen view. More...
 

Typedefs

using gf::UIWindowFlags = Flags< UIWindow >
 Flags composed of window properties. More...
 
using gf::UIScroll = Vector< unsigned short, 2 >
 State for scrollbar in groups. More...
 

Enumerations

enum  gf::Alignment {
  gf::Alignment::None,
  gf::Alignment::Left,
  gf::Alignment::Right,
  gf::Alignment::Center,
  gf::Alignment::Justify
}
 The alignement of a text. More...
 
enum  gf::BlendEquation {
  gf::BlendEquation::Add,
  gf::BlendEquation::Substract,
  gf::BlendEquation::ReverseSubstract
}
 Enumeration of the blending equations. More...
 
enum  gf::BlendFactor {
  gf::BlendFactor::Zero,
  gf::BlendFactor::One,
  gf::BlendFactor::SrcColor,
  gf::BlendFactor::OneMinusSrcColor,
  gf::BlendFactor::DstColor,
  gf::BlendFactor::OneMinusDstColor,
  gf::BlendFactor::SrcAlpha,
  gf::BlendFactor::OneMinusSrcAlpha,
  gf::BlendFactor::DstAlpha,
  gf::BlendFactor::OneMinusDstAlpha
}
 Enumeration of the blending factors. More...
 
enum  gf::Curve::Type {
  gf::Curve::Simple,
  gf::Curve::Outlined
}
 The type of the curve. More...
 
enum  gf::ColorEffect::Type {
  gf::ColorEffect::Normal,
  gf::ColorEffect::Grayscale,
  gf::ColorEffect::Sepia,
  gf::ColorEffect::NightVision,
  gf::ColorEffect::Warm,
  gf::ColorEffect::Cool
}
 Type of color effect. More...
 
enum  gf::ColorBlindEffect::Type {
  gf::ColorBlindEffect::Normal,
  gf::ColorBlindEffect::Protanopia,
  gf::ColorBlindEffect::Protanomaly,
  gf::ColorBlindEffect::Deuteranopia,
  gf::ColorBlindEffect::Deuteranomaly,
  gf::ColorBlindEffect::Tritanopia,
  gf::ColorBlindEffect::Tritanomaly,
  gf::ColorBlindEffect::Achromatopsia,
  gf::ColorBlindEffect::Achromatomaly
}
 Type of color blindness. More...
 
enum  gf::PrimitiveType {
  gf::PrimitiveType::Points,
  gf::PrimitiveType::LineStrip,
  gf::PrimitiveType::LineLoop,
  gf::PrimitiveType::Lines,
  gf::PrimitiveType::TriangleStrip,
  gf::PrimitiveType::TriangleFan,
  gf::PrimitiveType::Triangles
}
 Kind of primitives to render. More...
 
enum  gf::Shader::Type {
  gf::Shader::Vertex,
  gf::Shader::Fragment
}
 Type of shaders. More...
 
enum  gf::BareTexture::Format {
  gf::BareTexture::Format::Color,
  gf::BareTexture::Format::Alpha
}
 Format of the texture. More...
 
enum  gf::Anchor {
  gf::Anchor::TopLeft,
  gf::Anchor::TopCenter,
  gf::Anchor::TopRight,
  gf::Anchor::CenterLeft,
  gf::Anchor::Center,
  gf::Anchor::CenterRight,
  gf::Anchor::BottomLeft,
  gf::Anchor::BottomCenter,
  gf::Anchor::BottomRight
}
 The origin anchor of the transformable object. More...
 
enum  gf::UIWindow : uint32_t {
  gf::UIWindow::Border = 0x0001,
  gf::UIWindow::Movable = 0x0002,
  gf::UIWindow::Scalable = 0x0004,
  gf::UIWindow::Closable = 0x0008,
  gf::UIWindow::Minimizable = 0x0010,
  gf::UIWindow::NoScrollbar = 0x0020,
  gf::UIWindow::Title = 0x0040,
  gf::UIWindow::ScrollAutoHide = 0x0080,
  gf::UIWindow::Background = 0x0100
}
 Properties for windows and window-like elements. More...
 
enum  gf::UICollapse : bool {
  gf::UICollapse::Minimized = false,
  gf::UICollapse::Maximized = true
}
 Collapse property of a tree. More...
 
enum  gf::UILayout {
  gf::UILayout::Dynamic = 0,
  gf::UILayout::Static = 1
}
 Layout property for rows. More...
 
enum  gf::UITree {
  gf::UITree::Node = 0,
  gf::UITree::Tab = 1
}
 The type of tree. More...
 
enum  gf::UIAlignment {
  gf::UIAlignment::Left = 0x10 | 0x01,
  gf::UIAlignment::Center = 0x10 | 0x02,
  gf::UIAlignment::Right = 0x10 | 0x04
}
 The alignment of the text. More...
 
enum  gf::UIButtonBehavior {
  gf::UIButtonBehavior::Default = 0,
  gf::UIButtonBehavior::Repeater = 1
}
 Behavior for buttons. More...
 
enum  gf::UIProgress : bool {
  gf::UIProgress::Fixed = false,
  gf::UIProgress::Modifyable = true
}
 State of the progress bar. More...
 
enum  gf::UISymbol {
  gf::UISymbol::None,
  gf::UISymbol::X,
  gf::UISymbol::Underscore,
  gf::UISymbol::CircleSolid,
  gf::UISymbol::CircleOutline,
  gf::UISymbol::RectSolid,
  gf::UISymbol::RectOutline,
  gf::UISymbol::TriangleUp,
  gf::UISymbol::TriangleDown,
  gf::UISymbol::TriangleLeft,
  gf::UISymbol::TriangleRight,
  gf::UISymbol::Plus,
  gf::UISymbol::Minus
}
 A representative symbol. More...
 
enum  gf::UIPopup {
  gf::UIPopup::Static = 0,
  gf::UIPopup::Dynamic = 1
}
 Type of popup. More...
 
enum  gf::UIPredefinedStyle {
  gf::UIPredefinedStyle::Default,
  gf::UIPredefinedStyle::White,
  gf::UIPredefinedStyle::Red,
  gf::UIPredefinedStyle::Blue,
  gf::UIPredefinedStyle::Dark
}
 A predefined style. More...
 

Functions

bool operator== (const RenderStates &lhs, const RenderStates &rhs)
 Check render states equality. More...
 

Variables

constexpr BlendMode gf::BlendAlpha
 Alpha blend mode. More...
 
constexpr BlendMode gf::BlendAdd
 Additive blend mode. More...
 
constexpr BlendMode gf::BlendMultiply
 Multiplicative blend mode. More...
 
constexpr BlendMode gf::BlendNone
 No blend mode. More...
 

Detailed Description

All the classes related to graphics.

Typedef Documentation

using gf::UIScroll = typedef Vector<unsigned short, 2>

State for scrollbar in groups.

using gf::UIWindowFlags = typedef Flags<UIWindow>

Flags composed of window properties.

See also
gf::UIWindow

Enumeration Type Documentation

enum gf::Alignment
strong

The alignement of a text.

Enumerator
None 

No alignement.

Left 

Left alignement.

Right 

Right alignement.

Center 

Centered alignment.

Justify 

Justified alignment.

enum gf::Anchor
strong

The origin anchor of the transformable object.

See also
Transformable::setOrigin()
Enumerator
TopLeft 

Top-left.

TopCenter 

Top-center.

TopRight 

Top-right.

CenterLeft 

Center-left.

Center 

Center.

CenterRight 

Center-right.

BottomLeft 

Bottom-left.

BottomCenter 

Bottom-center.

BottomRight 

Bottom-right.

enum gf::BlendEquation
strong

Enumeration of the blending equations.

The equations are mapped directly to their OpenGL equivalents, specified by glBlendEquation() or glBlendEquationSeparate().

See also
gf::BlendMode
Enumerator
Add 

Pixel = Src * SrcFactor + Dst * DstFactor.

Substract 

Pixel = Src * SrcFactor - Dst * DstFactor.

ReverseSubstract 

Pixel = Dst * DstFactor - Src * SrcFactor.

enum gf::BlendFactor
strong

Enumeration of the blending factors.

The factors are mapped directly to their OpenGL equivalents, specified by glBlendFunc() or glBlendFuncSeparate().

See also
gf::BlendMode
Enumerator
Zero 

(0, 0, 0, 0)

One 

(1, 1, 1, 1)

SrcColor 

(src.r, src.g, src.b, src.a)

OneMinusSrcColor 

(1, 1, 1, 1) - (src.r, src.g, src.b, src.a)

DstColor 

(dst.r, dst.g, dst.b, dst.a)

OneMinusDstColor 

(1, 1, 1, 1) - (dst.r, dst.g, dst.b, dst.a)

SrcAlpha 

(src.a, src.a, src.a, src.a)

OneMinusSrcAlpha 

(1, 1, 1, 1) - (src.a, src.a, src.a, src.a)

DstAlpha 

(dst.a, dst.a, dst.a, dst.a)

OneMinusDstAlpha 

(1, 1, 1, 1) - (dst.a, dst.a, dst.a, dst.a)

Format of the texture.

See also
gf::BareTexture
Enumerator
Color 

RGBA format.

Alpha 

Alpha format.

enum gf::PrimitiveType
strong

Kind of primitives to render.

gf::PrimitiveType represents a kind of primitive to render. The primitives are mapped to their OpenGL equivalents, specified by glDrawArrays or glDrawElements.

See also
gf::RenderTarget::draw
Enumerator
Points 

List of individual points.

LineStrip 

List of connected lines, a point uses the previous point to form a line.

LineLoop 

List of connected lines, a point uses the previous point to form a line, the last point is connected to the first.

Lines 

List of individual lines.

TriangleStrip 

List of connected triangles, a point uses the two previous points to form a triangle.

TriangleFan 

List of connected triangles, a point uses the common center and the previous point to form a triangle.

Triangles 

List of individual triangles.

The type of the curve.

Enumerator
Simple 

A simple curve with no outline.

Outlined 

An outlined curve.

Type of color effect.

Enumerator
Normal 

No effect.

Grayscale 

Grayscale.

Sepia 

Sepia colors.

NightVision 

Night vision.

Warm 

Warm colors.

Cool 

Cool colors.

Type of shaders.

Enumerator
Vertex 

Type for a vertex shader.

Fragment 

Type for a fragment (or pixel) shader.

Type of color blindness.

Enumerator
Normal 

Normal vision.

Protanopia 

Protanopia (red dichromacy, 1% of males affected)

Protanomaly 

Protanomaly (red trichromacy, 1% of males affected)

Deuteranopia 

Deuteranopia (green dichromacy, 1% of males affected)

Deuteranomaly 

Deuteranomaly (green trichromacy, 6% of males affected)

Tritanopia 

Tritanopia (blue dichromacy, rare)

Tritanomaly 

Tritanomaly (blue trichromacy, very rare)

Achromatopsia 

Achromatopsia (rod monochromacy, very rare)

Achromatomaly 

Achromatomaly (blue cone monochromacy, very rare)

enum gf::UIAlignment
strong

The alignment of the text.

See also
gf::Alignment
Enumerator
Left 

Left alignment.

Center 

Centered alignment.

Right 

Right alignment.

enum gf::UIButtonBehavior
strong

Behavior for buttons.

Enumerator
Default 

The button is active once.

Repeater 

The button is active as long as it is pressed.

enum gf::UICollapse : bool
strong

Collapse property of a tree.

Enumerator
Minimized 

The tree is minimized.

Maximized 

The tree is maximized.

enum gf::UILayout
strong

Layout property for rows.

Enumerator
Dynamic 

The row has a dynamic layout.

Static 

The row has a static layout.

enum gf::UIPopup
strong

Type of popup.

Enumerator
Static 

The popup is static.

Dynamic 

The popup is dynamic.

enum gf::UIPredefinedStyle
strong

A predefined style.

Enumerator
Default 

The default style.

White 

A light gray style.

Red 

A red and gray style.

Blue 

A blue and light gray style.

Dark 

A dark gray and dark blue style.

enum gf::UIProgress : bool
strong

State of the progress bar.

Enumerator
Fixed 

The progress bar is fixed.

Modifyable 

The progress bar can be modified.

enum gf::UISymbol
strong

A representative symbol.

Enumerator
None 

No symbol.

X symbol.

Underscore 

Underscore.

CircleSolid 

Solid circle.

CircleOutline 

Outline circle.

RectSolid 

Solid rectangle.

RectOutline 

Outline rectangle.

TriangleUp 

Triangle up.

TriangleDown 

Triangle down.

TriangleLeft 

Triangle left.

TriangleRight 

Triangle right.

Plus 

Plus.

Minus 

Minus.

enum gf::UITree
strong

The type of tree.

Enumerator
Node 

The tree is a node, generally an internal node of the tree.

Tab 

The tree is a tabulation, generally the root of the tree.

enum gf::UIWindow : uint32_t
strong

Properties for windows and window-like elements.

See also
gf::UIWindowFlags
Enumerator
Border 

The window has a border.

Movable 

The window can be moved by the user.

Scalable 

The window is scalable by the user.

Closable 

The window can be closed with an icon in the header.

Minimizable 

The window can be minimized with an icon in the header.

NoScrollbar 

The window has no scrollbar.

Title 

The window has a title in the header.

ScrollAutoHide 

The window's scrollbar can hide automatically.

Background 

The window is in the background.

Function Documentation

bool operator== ( const RenderStates lhs,
const RenderStates rhs 
)
related

Check render states equality.

Two render states are equals if their blend mode, their transform matrix, their texture and their shader are the same.

Variable Documentation

constexpr BlendMode gf::BlendAdd

Additive blend mode.

Add source to dest.

See also
gf::BlendMode
constexpr BlendMode gf::BlendAlpha

Alpha blend mode.

Blend source and dest according to dest alpha. Also known as alpha blending.

See also
gf::BlendMode
constexpr BlendMode gf::BlendMultiply

Multiplicative blend mode.

Multiply source and dest.

See also
gf::BlendMode
constexpr BlendMode gf::BlendNone

No blend mode.

Overwrite dest with source.

See also
gf::BlendMode