UGDK  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ugdk::graphic::Canvas Class Reference

#include <ugdk/graphic/canvas.h>

Public Member Functions

 Canvas (RenderTarget *render_target)
 
 ~Canvas ()
 
void ChangeShaderProgram (const ShaderProgram *shader_program)
 
bool IsActive () const
 Queries if this object is currently bound. More...
 
math::Vector2D size () const
 
const math::Geometrycurrent_geometry () const
 
const structure::VisualEffectcurrent_visualeffect () const
 
const ShaderProgramshader_program () const
 
void PushAndCompose (const math::Geometry &geometry)
 
void PushAndCompose (const structure::VisualEffect &effect)
 
void PopGeometry ()
 
void PopVisualEffect ()
 
void Clear (structure::Color)
 
void SendUniform (const std::string &name, float t1)
 
void SendUniform (const std::string &name, float t1, float t2)
 
void SendUniform (const std::string &name, const math::Vector2D &)
 
void SendUniform (const std::string &name, float t1, float t2, float t3)
 
void SendUniform (const std::string &name, float t1, float t2, float t3, float t4)
 
void SendUniform (const std::string &name, const TextureUnit &unit)
 
void SendVertexData (const VertexData &data, VertexType type, size_t offset, int size=2, int vertex_per_data=1)
 The VertexType should later be disabled using Manager::DisableVertexType. More...
 
void DrawArrays (DrawMode, int first_vertex, int vertex_count)
 

Detailed Description

Binds the RenderTarget to allow rendering. Unbinds automatically on destructor. Creating multiple instances at the same time are supported, but the lifetime of the instances should act as a stack. TODO: example about this.

The only valid calls on inactive instances are const-qualified methods.

Constructor & Destructor Documentation

ugdk::graphic::Canvas::Canvas ( RenderTarget render_target)
ugdk::graphic::Canvas::~Canvas ( )

Member Function Documentation

void ugdk::graphic::Canvas::ChangeShaderProgram ( const ShaderProgram shader_program)
void ugdk::graphic::Canvas::Clear ( structure::Color  )
const math::Geometry& ugdk::graphic::Canvas::current_geometry ( ) const
inline
const structure::VisualEffect& ugdk::graphic::Canvas::current_visualeffect ( ) const
inline
void ugdk::graphic::Canvas::DrawArrays ( DrawMode  ,
int  first_vertex,
int  vertex_count 
)
bool ugdk::graphic::Canvas::IsActive ( ) const

Queries if this object is currently bound.

void ugdk::graphic::Canvas::PopGeometry ( )
void ugdk::graphic::Canvas::PopVisualEffect ( )
void ugdk::graphic::Canvas::PushAndCompose ( const math::Geometry geometry)
void ugdk::graphic::Canvas::PushAndCompose ( const structure::VisualEffect effect)
void ugdk::graphic::Canvas::SendUniform ( const std::string &  name,
float  t1 
)
void ugdk::graphic::Canvas::SendUniform ( const std::string &  name,
float  t1,
float  t2 
)
void ugdk::graphic::Canvas::SendUniform ( const std::string &  name,
const math::Vector2D  
)
void ugdk::graphic::Canvas::SendUniform ( const std::string &  name,
float  t1,
float  t2,
float  t3 
)
void ugdk::graphic::Canvas::SendUniform ( const std::string &  name,
float  t1,
float  t2,
float  t3,
float  t4 
)
void ugdk::graphic::Canvas::SendUniform ( const std::string &  name,
const TextureUnit unit 
)
void ugdk::graphic::Canvas::SendVertexData ( const VertexData data,
VertexType  type,
size_t  offset,
int  size = 2,
int  vertex_per_data = 1 
)

The VertexType should later be disabled using Manager::DisableVertexType.

const ShaderProgram* ugdk::graphic::Canvas::shader_program ( ) const
inline
math::Vector2D ugdk::graphic::Canvas::size ( ) const

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