draw  0.0.0
Classes | Typedefs | Enumerations | Functions
draw Namespace Reference

Classes

struct  Color
 RGBA floating-point color. More...
 
class  Context
 OpenGL rendering context base interface class. More...
 
class  Font
 Set of characters of the same style and size. More...
 
class  Geometry
 Set of indexed 2D-primitives. More...
 
class  Image
 2D-array of pixels specified format. More...
 
struct  Point
 A point in pixel space. More...
 
struct  Rect
 A rect in pixel space. More...
 
class  Renderer
 Factory and context owner. More...
 
class  Shape
 A visual shape. More...
 
struct  Size
 A size in pixel space. More...
 
struct  Span
 Contiguous sequence of elements. More...
 
class  Text
 A text object. More...
 
struct  Vector2
 Floating-point 2D-vector. More...
 
class  Visual
 Base interface class of any visual object. More...
 

Typedefs

using GeometryPtr = SHARED_PTR< Geometry >
 
using ImagePtr = SHARED_PTR< Image >
 
using VisualPtr = SHARED_PTR< Visual >
 
using ShapePtr = SHARED_PTR< Shape >
 
using FontPtr = SHARED_PTR< Font >
 
using TextPtr = SHARED_PTR< Text >
 
using RendererPtr = SHARED_PTR< Renderer >
 
using ContextPtr = std::unique_ptr< Context >
 

Enumerations

enum  ErrorCode {
  NoError = 0, InvalidArgument, OpenGLAbsentFeature, OpenGLOutOfMemory,
  InvalidFontFile, IncompleteFontFile
}
 An error code which library can generate. More...
 

Functions

ErrorCode getLastError ()
 return last error and set the value to draw::NoError More...
 
bool operator== (const Point &left, const Point &right)
 checks if two points are equal More...
 
bool operator!= (const Point &left, const Point &right)
 checks if two points are not equal More...
 
bool operator== (const Size &left, const Size &right)
 checks if two sizes are equal More...
 
bool operator!= (const Size &left, const Size &right)
 checks if two sizes are not equal More...
 
bool operator== (const Rect &left, const Rect &right)
 checks if two rects are equal More...
 
bool operator!= (const Rect &left, const Rect &right)
 checks if two rects are not equal More...
 
RendererPtr makeRenderer (ContextPtr context)
 make Renderer object More...
 

Typedef Documentation

using draw::ContextPtr = typedef std::unique_ptr<Context>
using draw::FontPtr = typedef SHARED_PTR<Font>
using draw::ImagePtr = typedef SHARED_PTR<Image>
using draw::ShapePtr = typedef SHARED_PTR<Shape>
using draw::TextPtr = typedef SHARED_PTR<Text>
using draw::VisualPtr = typedef SHARED_PTR<Visual>

Enumeration Type Documentation

An error code which library can generate.

Enumerator
NoError 

there are no errors

InvalidArgument 

argument is invalid

OpenGLAbsentFeature 

some OpenGL features are not supported by your hardware

OpenGLOutOfMemory 

memory is not enough to create OpenGL resource

InvalidFontFile 

a file which contains font glyphs is not found or corrupted

IncompleteFontFile 

some alphabet's glyphs are not contained in the font file

Function Documentation

ErrorCode draw::getLastError ( )

return last error and set the value to draw::NoError

RendererPtr draw::makeRenderer ( ContextPtr  context)

make Renderer object

NOTE: exceptions are disabled. 'Exceptions' section lists expected errors which you can obtain via draw::getLastError.

Parameters
contextIt's recommended to move ownership of the context immediately to the renderer: makeRenderer(std::move(make_unique<ContextImpl>())).
Exceptions
draw::InvalidArgumentif context is invalid
draw::OpenGLAbsentFeatureif OpenGL 2.0 or ARB_draw_instanced are not supported
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
bool draw::operator!= ( const Point left,
const Point right 
)

checks if two points are not equal

bool draw::operator!= ( const Size left,
const Size right 
)

checks if two sizes are not equal

bool draw::operator!= ( const Rect left,
const Rect right 
)

checks if two rects are not equal

bool draw::operator== ( const Point left,
const Point right 
)

checks if two points are equal

bool draw::operator== ( const Size left,
const Size right 
)

checks if two sizes are equal

bool draw::operator== ( const Rect left,
const Rect right 
)

checks if two rects are equal