![]() |
Gorgon Game Engine
|
Contains generic 2D graphics related data structures and functions. More...
Namespaces | |
Color | |
Contains commonly used colors identified by XKCD survey containing 140000 people. | |
HTMLRendererInternal | |
internal | |
Functions inside this namespace is designed for internal use, however, they might be used externally and will not have any impact on inner workings of the system. | |
Classes | |
class | AlphaShader |
class | Animation |
A regular drawable animation. More... | |
class | AnimationProvider |
A regular drawable animation provider. More... | |
class | basic_AnimatedPointer |
Represents animated pointer. More... | |
class | basic_AnimationFrame |
class | basic_LineProvider |
This class allows instancing of a line like image that is made out of three parts. More... | |
class | basic_MaskedObject |
class | basic_MaskedObjectProvider |
This object creates a masked object from two graphics object. More... | |
class | basic_PointerProvider |
This class stores information that allows an animated pointer to be created. More... | |
class | basic_RectangleProvider |
This class allows instancing of a rectangle like image that is made out of three parts. More... | |
class | basic_ScalableObject |
class | basic_ScalableObjectProvider |
This object creates a scalable object from a graphic object. More... | |
class | basic_StackedObject |
class | basic_StackedObjectProvider |
This object creates an object that has two subobjects drawn on top of each other. More... | |
class | basic_TextureAnimation |
class | basic_TextureAnimationInjection |
class | basic_TextureAnimationInjection< Bitmap > |
class | basic_TextureAnimationProvider |
class | basic_TintedObject |
class | basic_TintedObjectProvider |
This object creates a scalable object from a graphic object. More... | |
class | BasicFont |
This is the basic font, performing the minimal amount of operations necessary to render text on the screen. More... | |
class | Bitmap |
This object contains an bitmap image. More... | |
class | BitmapFont |
Bitmap fonts provide an easy way to render text on the screen. More... | |
class | BlankImage |
Pure color blank image, default size is 0x0, but can be drawn with any size. More... | |
class | DiscreteAnimation |
A discrete rectangular animation, this is most suitable for bitmap or texture animations. More... | |
class | DiscreteAnimationProvider |
This class provides discrete and rectangular animation which is suitable for bitmap and texture animations. More... | |
class | Drawable |
Represents a drawable object, that can be drawn to the given point. More... | |
class | DrawablePointer |
This class turns a drawable into a pointer. More... | |
class | EmptyImage |
This class is an empty image that will not draw anything if drawn on a layer. More... | |
class | FillShader |
class | FontFamily |
class | FreeType |
This class allows using font files for text rendering. More... | |
class | GlyphRange |
This class represents a range of glyphs. Both start and end is included. More... | |
class | GlyphRenderer |
Should be implemented by the systems aimed to render fonts on the screen. More... | |
class | HTMLRenderer |
class | ILineProvider |
Interface for LineProviders. More... | |
class | Image |
This is an interface for solid texture based image. More... | |
class | ImageProvider |
class | IMaskedObjectProvider |
For ease of use in resource system. More... | |
class | IRectangleProvider |
Interface for RectangleProviders. More... | |
class | IScalableObjectProvider |
For ease of use in resource system. More... | |
class | IStackedObjectProvider |
For ease of use in resource system. More... | |
class | ITintedObjectProvider |
For ease of use in resource system. More... | |
class | Layer |
This layer allows drawing texture images on. More... | |
class | Line |
This class allows drawing a line like image that is made out of three parts. More... | |
class | MaskedAlphaShader |
class | MaskedFillShader |
class | MaskedShader |
class | Pointer |
Represents a pointer. More... | |
class | PointerStack |
This class manages a pointer stack that allows multiple pointers to be registered and switched. More... | |
class | Rectangle |
This class allows drawing a rectangle like image that is made out of nine parts. More... | |
class | RectangularAnimation |
Rectangular drawable animation. More... | |
class | RectangularAnimationProvider |
This class provides rectangular animations. More... | |
class | RectangularDrawable |
class | RGBA |
This class represents a color information. More... | |
class | RGBAf |
Represents a four channel 32 bit float per channel color information. More... | |
class | SimpleShader |
class | SizeController |
This class allows control over a sizable object. More... | |
class | SizelessDrawable |
A drawable object that does not have a size and requires a region to draw. More... | |
class | StyledRenderer |
This text renderer can style text according to the set parameters. More... | |
class | TextRenderer |
This class allows printing text on the screen. More... | |
class | TextShadow |
Describes how a text shadow should be. More... | |
class | Texture |
This class represents an image depends on a GL texture. More... | |
class | TextureImage |
This is a solid texture based image class. More... | |
class | TextureProvider |
class | TextureSource |
This interface represents a GL texture source. More... | |
class | TextureTarget |
This interface defines a class that can be used as a common target for texture based drawing. More... | |
Enumerations | |
enum | Alignment { Start, Center, End } |
Defines how an object is aligned. More... | |
enum | ColorMode { Invalid, Automatic, RGB, BGR, Grayscale, Alpha, RGBA, BGRA, Grayscale_Alpha } |
Color modes for images. More... | |
enum | Orientation { Horizontal, Vertical } |
2D orientation constants More... | |
enum | Placement { TopLeft, TopCenter, TopRight, MiddleLeft, MiddleCenter, MiddleRight, BottomLeft, BottomCenter, BottomRight } |
Defines how an object is placed in a 2D axis system. More... | |
enum | PointerType { None, Arrow, Wait, No, Text, Hand, Drag } |
Pointer types. More... | |
enum | ShaderMode { Normal, ToMask } |
enum | TextAlignment { Left, Center, Right } |
Defines how a text is aligned. More... | |
enum | Tiling { None, Horizontal, Vertical, Both } |
Details which directions a texture should tile. More... | |
Functions | |
RGBA | Blend (RGBA first, const RGBA &second) |
Blends two colors together, you do not need to use namespace if calling on an RGBA object. More... | |
RGBA | Blend (RGBA first, const RGBA &second, float alpha) |
Blends two colors together, you do not need to use namespace if calling on an RGBA object. More... | |
Geometry::Point | CalculateOffset (Placement place, Geometry::Size remainder) |
Returns the offset of the object according to the given placement rule when there is the given remainder between object size and the area its being drawn on. More... | |
int | GetAlphaIndex (ColorMode mode) |
Returns the index of alpha channel. If alpha channel does not exists, this function returns -1. More... | |
unsigned long | GetChannelsPerPixel (ColorMode mode) |
Returns bytes per pixel for the given color mode. More... | |
Alignment | GetHorizontal (Placement placement) |
Returns horizontal alignment from a placement. More... | |
Alignment | GetVertical (Placement placement) |
Returns vertical alignment from a placement. More... | |
bool | HasAlpha (ColorMode mode) |
Returns if the given color mode has alpha channel. More... | |
void | Initialize () |
Initializes Graphics module, should be performed after an OpenGL context is created. More... | |
std::ostream & | operator<< (std::ostream &stream, const RGBA &color) |
Prints the given color to the stream. More... | |
std::ostream & | operator<< (std::ostream &stream, const RGBAf &color) |
Prints the given color to the stream. More... | |
std::istream & | operator>> (std::istream &in, RGBA &color) |
Reads a color from the stream. More... | |
BitmapRectangleProvider | Slice (const Bitmap &source, Geometry::Bounds center) |
Slices an image to create a rectangle. More... | |
BitmapRectangleProvider | SliceHorizontal (const Bitmap &source, int t, int b, int tl, int tr, int l, int r, int bl, int br) |
Horizontally slices the given image. More... | |
BitmapRectangleProvider | SliceVertical (const Bitmap &source, int l, int r, int tl, int bl, int t, int b, int tr, int br) |
Vertically slices the given image. More... | |
Tiling | Tile (bool horizontal, bool vertical) |
Creates a Tiling class from the given horizontal, vertical tiling info. More... | |
Contains generic 2D graphics related data structures and functions.
These functions are tied to underlying GL system through textures.
using BitmapAnimationProvider = basic_TextureAnimationProvider<Bitmap, basic_TextureAnimation, basic_AnimationFrame<Bitmap> > |
using BitmapLineProvider = basic_LineProvider<Bitmap> |
using ConstBitmapAnimationProvider = basic_TextureAnimationProvider<const Bitmap, basic_TextureAnimation, basic_AnimationFrame<const Bitmap> > |
using ConstImageAnimationProvider = basic_TextureAnimationProvider<const Image, basic_TextureAnimation, basic_AnimationFrame<const Image> > |
using Glyph = Gorgon::Char |
Glyph is a symbol for a character. In Gorgon, glyphs are UTF32 chars.
using ImageAnimationProvider = basic_TextureAnimationProvider<Image, basic_TextureAnimation, basic_AnimationFrame<Image> > |
using MaskedBitmap = basic_MaskedObject<Bitmap> |
using ScalableBitmap = basic_ScalableObject<Bitmap> |
using StackedBitmap = basic_StackedObject<Bitmap> |
using TintedBitmap = basic_TintedObject<Bitmap> |
|
strong |
|
strong |
Color modes for images.
|
strong |
|
strong |
Defines how an object is placed in a 2D axis system.
|
strong |
|
strong |
|
strong |
|
strong |
Blends two colors together, you do not need to use namespace if calling on an RGBA object.
References RGBA::Blend().
Blends two colors together, you do not need to use namespace if calling on an RGBA object.
References RGBA::Blend().
Geometry::Point Gorgon::Graphics::CalculateOffset | ( | Placement | place, |
Geometry::Size | remainder | ||
) |
Returns the offset of the object according to the given placement rule when there is the given remainder between object size and the area its being drawn on.
Typical usage: CalculateOffset(Placement::MiddleCenter, areasize - objectsize)
References Center, End, GetHorizontal(), GetVertical(), basic_Size< T_ >::Height, Start, and basic_Size< T_ >::Width.
int Gorgon::Graphics::GetAlphaIndex | ( | ColorMode | mode | ) |
unsigned long Gorgon::Graphics::GetChannelsPerPixel | ( | ColorMode | mode | ) |
Returns horizontal alignment from a placement.
Returns vertical alignment from a placement.
bool Gorgon::Graphics::HasAlpha | ( | ColorMode | mode | ) |
Returns if the given color mode has alpha channel.
References Alpha.
void Initialize | ( | ) |
Initializes Graphics module, should be performed after an OpenGL context is created.
Initializes the filesystem module.
There is a mechanism to ensure initialization is performed once.
References Gorgon::WindowManager::CurrentContext(), glBindBuffer, glBindVertexArray, glBufferData, glEnableVertexAttribArray, glGenBuffers, glGenVertexArrays, glVertexAttribIPointer, Gorgon::GL::LoadFunctions(), Gorgon::Graphics::internal::quadvbo, Gorgon::Graphics::internal::quadvertexindex, and Gorgon::Graphics::internal::vaos.
std::ostream& Gorgon::Graphics::operator<< | ( | std::ostream & | stream, |
const RGBA & | color | ||
) |
Prints the given color to the stream.
std::ostream& Gorgon::Graphics::operator<< | ( | std::ostream & | stream, |
const RGBAf & | color | ||
) |
Prints the given color to the stream.
std::istream& Gorgon::Graphics::operator>> | ( | std::istream & | in, |
RGBA & | color | ||
) |
Reads a color from the stream.
This color can either be in full HTML format with # in front or a hex representation of the color with an optional 0x in front.
References RGBA::A, RGBA::B, RGBA::G, Gorgon::Graphics::internal::isspace(), and RGBA::R.
BitmapRectangleProvider Gorgon::Graphics::Slice | ( | const Bitmap & | source, |
Geometry::Bounds | center | ||
) |
Slices an image to create a rectangle.
Imagine a pound sign (#) slicing the image, center parameter is the central region of the pound sign. Currently this works only with bitmaps. This function will create an atlas out of the given image, thus, the source should be kept alive. Currently atlas functionality does not work.
References basic_Bounds< T_ >::Bottom, basic_Bounds< T_ >::Left, basic_Bounds< T_ >::Right, SliceHorizontal(), and basic_Bounds< T_ >::Top.
BitmapRectangleProvider SliceHorizontal | ( | const Bitmap & | source, |
int | t, | ||
int | b, | ||
int | tl, | ||
int | tr, | ||
int | l, | ||
int | r, | ||
int | bl, | ||
int | br | ||
) |
Horizontally slices the given image.
t and b slices the image to 3 parts then each part is further sliced by X offset pairs (tl, tr), (l, r), and (bl, br). Currently this works only with bitmaps. This function will create an atlas out of the given image, thus, the source should be kept alive. Currently atlas functionality does not work.
References Bitmap::Slice().
BitmapRectangleProvider SliceVertical | ( | const Bitmap & | source, |
int | l, | ||
int | r, | ||
int | tl, | ||
int | bl, | ||
int | t, | ||
int | b, | ||
int | tr, | ||
int | br | ||
) |
Vertically slices the given image.
l and r slices the image to 3 parts then each part is further sliced by Y offset pairs (tl, bl), (t, b), and (tr, br). Currently this works only with bitmaps. This function will create an atlas out of the given image, thus, the source should be kept alive. Currently atlas functionality does not work.
References Bitmap::Slice().
Tiling Gorgon::Graphics::Tile | ( | bool | horizontal, |
bool | vertical | ||
) |
Creates a Tiling class from the given horizontal, vertical tiling info.
References Horizontal, None, and Vertical.