Gamedev Framework (gf)  0.6.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::Coordinates
 Helper to compute coordinates in HUD. 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...
 
struct  gf::GraphicsInfo::Format
 An OpenGL format. More...
 
class  gf::GraphicsInfo
 A class for graphics info. More...
 
class  gf::SquareGrid
 A square grid. More...
 
class  gf::Image
 Class for loading, manipulating and saving images. More...
 
class  gf::Logo
 The gf logo. More...
 
class  gf::NinePatch
 A nine-patch. More...
 
class  gf::PointParticles
 A class to display a high number of points. More...
 
class  gf::ShapeParticles
 A class to display a high number of small simple shapes. More...
 
class  gf::SpriteParticles
 A class to display a high number of sprites. 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...
 
struct  gf::UIEditType
 Predefined flags for edit. More...
 
struct  gf::UIBrowser
 Data for file selector. 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::ZoomingViewAdaptor
 A view adaptor for zooming/moving with the mouse. 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::LockedView
 Locked view. More...
 
class  gf::ScreenView
 Screen view. More...
 

Typedefs

using gf::UIWindowFlags = Flags< UIWindow >
 Flags composed of window properties. More...
 
using gf::UIScroll = Vector2u
 State for scrollbar in groups. More...
 
using gf::UIEditFlags = Flags< UIEdit >
 Flags composed of edit properties. More...
 
using gf::UIEditEventFlags = Flags< UIEditEvent >
 Flags composed of edit events properties. 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::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
}
 An anchor of a box. 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::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::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,
  gf::UIWindow::ScaleLeft = 0x0200,
  gf::UIWindow::NoInput = 0x0400
}
 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::UIEdit : uint32_t {
  gf::UIEdit::Default = 0x0000,
  gf::UIEdit::ReadOnly = 0x0001,
  gf::UIEdit::AutoSelect = 0x0002,
  gf::UIEdit::SigEnter = 0x0004,
  gf::UIEdit::AllowTab = 0x0008,
  gf::UIEdit::NoCursor = 0x0010,
  gf::UIEdit::Selectable = 0x0020,
  gf::UIEdit::Clipboard = 0x0040,
  gf::UIEdit::CtrlEnterNewline = 0x0080,
  gf::UIEdit::NoHorizontalScroll = 0x0100,
  gf::UIEdit::AlwaysInsertMode = 0x0200,
  gf::UIEdit::Multiline = 0x0400,
  gf::UIEdit::GotoEndOnActivate = 0x0800
}
 Properties for edit widgets. More...
 
enum  gf::UIEditEvent : uint32_t {
  gf::UIEditEvent::Active = 0x0001,
  gf::UIEditEvent::Inactive = 0x0002,
  gf::UIEditEvent::Activated = 0x0004,
  gf::UIEditEvent::Deactivated = 0x0008,
  gf::UIEditEvent::Commited = 0x0010
}
 Properties for edit events. More...
 
enum  gf::UIEditFilter {
  gf::UIEditFilter::Default,
  gf::UIEditFilter::Ascii,
  gf::UIEditFilter::Float,
  gf::UIEditFilter::Decimal,
  gf::UIEditFilter::Hex,
  gf::UIEditFilter::Oct,
  gf::UIEditFilter::Binary
}
 Filters for edit. 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

◆ UIEditEventFlags

Flags composed of edit events properties.

See also
gf::UIEditEvent

◆ UIEditFlags

using gf::UIEditFlags = typedef Flags<UIEdit>

Flags composed of edit properties.

See also
gf::UIEdit

◆ UIScroll

using gf::UIScroll = typedef Vector2u

State for scrollbar in groups.

◆ UIWindowFlags

using gf::UIWindowFlags = typedef Flags<UIWindow>

Flags composed of window properties.

See also
gf::UIWindow

Enumeration Type Documentation

◆ Alignment

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.

◆ Anchor

enum gf::Anchor
strong

An anchor of a box.

It is used to define the origin in transformable objects. It is also used to compute coordinates for HUD.

See also
gf::Transformable, gf::Coordinates
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.

◆ BlendEquation

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.

◆ BlendFactor

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)

◆ PrimitiveType

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.

◆ UIAlignment

enum gf::UIAlignment
strong

The alignment of the text.

See also
gf::Alignment
Enumerator
Left 

Left alignment.

Center 

Centered alignment.

Right 

Right alignment.

◆ UIButtonBehavior

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.

◆ UICollapse

enum gf::UICollapse : bool
strong

Collapse property of a tree.

Enumerator
Minimized 

The tree is minimized.

Maximized 

The tree is maximized.

◆ UIEdit

enum gf::UIEdit : uint32_t
strong

Properties for edit widgets.

Enumerator
Default 
ReadOnly 
AutoSelect 
SigEnter 
AllowTab 
NoCursor 
Selectable 
Clipboard 
CtrlEnterNewline 
NoHorizontalScroll 
AlwaysInsertMode 
Multiline 
GotoEndOnActivate 

◆ UIEditEvent

enum gf::UIEditEvent : uint32_t
strong

Properties for edit events.

Enumerator
Active 

Edit widget is currently being modified.

Inactive 

Edit widget is not active and is not being modified.

Activated 

Edit widget went from state inactive to state active.

Deactivated 

Edit widget went from state active to state inactive.

Commited 

Edit widget has received an enter and lost focus.

◆ UIEditFilter

enum gf::UIEditFilter
strong

Filters for edit.

Enumerator
Default 
Ascii 
Float 
Decimal 
Hex 
Oct 
Binary 

◆ UILayout

enum gf::UILayout
strong

Layout property for rows.

Enumerator
Dynamic 

The row has a dynamic layout.

Static 

The row has a static layout.

◆ UIPopup

enum gf::UIPopup
strong

Type of popup.

Enumerator
Static 

The popup is static.

Dynamic 

The popup is dynamic.

◆ UIPredefinedStyle

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.

◆ UIProgress

enum gf::UIProgress : bool
strong

State of the progress bar.

Enumerator
Fixed 

The progress bar is fixed.

Modifyable 

The progress bar can be modified.

◆ UISymbol

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.

◆ UITree

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.

◆ UIWindow

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.

ScaleLeft 

The window's scaler is on the left.

NoInput 

The window can not scale, move or get focus.

Function Documentation

◆ operator==()

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

◆ BlendAdd

constexpr BlendMode gf::BlendAdd

Additive blend mode.

Add source to dest.

See also
gf::BlendMode

◆ BlendAlpha

constexpr BlendMode gf::BlendAlpha

Alpha blend mode.

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

See also
gf::BlendMode

◆ BlendMultiply

constexpr BlendMode gf::BlendMultiply

Multiplicative blend mode.

Multiply source and dest.

See also
gf::BlendMode

◆ BlendNone

constexpr BlendMode gf::BlendNone

No blend mode.

Overwrite dest with source.

See also
gf::BlendMode