draw  0.0.0
Public Member Functions | List of all members
draw::Renderer Class Referenceabstract

Factory and context owner. More...

#include <draw.h>

Public Member Functions

virtual ~Renderer ()=default
 destruct renderer and owned context More...
 
virtual GeometryPtr makeGeometry (Geometry::Vertices vertices, Geometry::Indices indices, Geometry::Primitive primitive)=0
 make Geometry object More...
 
virtual ImagePtr makeImage (const Size &size, Image::Format format, bool filter)=0
 make Image object More...
 
virtual FontPtr makeFont (const char *filePath, uint32_t letterSize)=0
 make Font object More...
 
virtual ShapePtr makeRect ()=0
 make Shape object with rectangle Geometry More...
 
virtual ShapePtr makeShape ()=0
 make Shape object More...
 
virtual TextPtr makeText ()=0
 make Text object More...
 
virtual uint32_t draw (const Color &clear)=0
 clear the screen and repaint all visible objects More...
 
virtual void resize (const Size &size)=0
 set a new screen size More...
 

Detailed Description

Factory and context owner.

To create an object of this type use draw::makeRenderer function.

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

Constructor & Destructor Documentation

virtual draw::Renderer::~Renderer ( )
virtualdefault

destruct renderer and owned context

Note: all created objects must be destroyed before the renderer object

Member Function Documentation

virtual uint32_t draw::Renderer::draw ( const Color clear)
pure virtual

clear the screen and repaint all visible objects

Returns
drawn objects count
virtual FontPtr draw::Renderer::makeFont ( const char *  filePath,
uint32_t  letterSize 
)
pure virtual

make Font object

Exceptions
draw::InvalidArgumentif filePath is invalid
draw::InvalidArgumentif letterSize is less than Font::kMinLetterSize
draw::InvalidFontFileif font file is not exist or corrupted
draw::IncompleteFontFileif some alphabet's glyphs is not contained in the font file
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
virtual GeometryPtr draw::Renderer::makeGeometry ( Geometry::Vertices  vertices,
Geometry::Indices  indices,
Geometry::Primitive  primitive 
)
pure virtual

make Geometry object

Exceptions
draw::InvalidArgumentif vertices.data is invalid
draw::InvalidArgumentif vertices.count is zero or > Geometry::kMaxVertexCount
draw::InvalidArgumentif indices.data is invalid
draw::InvalidArgumentif indices.count is zero
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
virtual ImagePtr draw::Renderer::makeImage ( const Size size,
Image::Format  format,
bool  filter 
)
pure virtual

make Image object

Parameters
size
format
filteruse bilinear filtering or not
Exceptions
draw::InvalidArgumentif size.width is zero or > Image::kMaxSize
draw::InvalidArgumentif size.height is zero or > Image::kMaxSize
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
virtual ShapePtr draw::Renderer::makeRect ( )
pure virtual

make Shape object with rectangle Geometry

Exceptions
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
virtual ShapePtr draw::Renderer::makeShape ( )
pure virtual

make Shape object

Exceptions
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
virtual TextPtr draw::Renderer::makeText ( )
pure virtual

make Text object

Exceptions
draw::OpenGLOutOfMemoryif is not enough memory to create internal OpenGL resources
virtual void draw::Renderer::resize ( const Size size)
pure virtual

set a new screen size


The documentation for this class was generated from the following file: