gui::gl::manager Class Reference

Abstract type for implementation specific management. More...

#include <gui_gl_manager.hpp>

Inheritance diagram for gui::gl::manager:
gui::manager_impl

List of all members.

Public Member Functions

 manager (bool bInitGLEW=true)
 Constructor.
 ~manager ()
 Destructor.
void begin (utils::refptr< gui::render_target > pTarget=nullptr) const
 Begins rendering on a particular render target.
void end () const
 Ends rendering.
virtual void render_quad (const quad &mQuad) const
 Renders a quad.
virtual void render_quads (const quad &mQuad, const std::vector< std::array< vertex, 4 >> &lQuadList) const
 Renders a set of quads.
utils::refptr< gui::materialcreate_material (const std::string &sFileName) const
 Creates a new material from a texture file.
utils::refptr< gui::materialcreate_material (const color &mColor) const
 Creates a new material from a plain color.
utils::refptr< gui::materialcreate_material (utils::refptr< gui::render_target > pRenderTarget) const
 Creates a new material from a render target.
utils::refptr< gui::render_targetcreate_render_target (uint uiWidth, uint uiHeight) const
 Creates a new render target.
utils::refptr< gui::fontcreate_font (const std::string &sFontFile, uint uiSize) const
 Creates a new font.

Static Public Member Functions

static bool is_gl_extension_supported (const std::string &sExtension)
 Checks if a given OpenGL extension is supported by the machine.

Detailed Description

Abstract type for implementation specific management.

Definition at line 14 of file gui_gl_manager.hpp.


Constructor & Destructor Documentation

gui::gl::manager::manager ( bool  bInitGLEW = true  ) 

Constructor.

Definition at line 16 of file gui_gl_manager.cpp.

gui::gl::manager::~manager (  ) 

Destructor.

Definition at line 26 of file gui_gl_manager.cpp.


Member Function Documentation

void gui::gl::manager::begin ( utils::refptr< gui::render_target pTarget = nullptr  )  const

Begins rendering on a particular render target.

Parameters:
pTarget The render target (main screen if nullptr)

Definition at line 30 of file gui_gl_manager.cpp.

utils::refptr< gui::font > gui::gl::manager::create_font ( const std::string &  sFontFile,
uint  uiSize 
) const [virtual]

Creates a new font.

Parameters:
sFontFile The file from which to read the font
uiSize The requested size of the characters (in points)
Note:
This implementation uses FreeType to load vector fonts and rasterize them. Bitmap fonts are not yet supported.

Implements gui::manager_impl.

Definition at line 206 of file gui_gl_manager.cpp.

utils::refptr< gui::material > gui::gl::manager::create_material ( utils::refptr< gui::render_target pRenderTarget  )  const

Creates a new material from a render target.

Parameters:
pRenderTarget The render target from which to read the pixels
Returns:
The new material

Definition at line 196 of file gui_gl_manager.cpp.

utils::refptr< gui::material > gui::gl::manager::create_material ( const color mColor  )  const [virtual]

Creates a new material from a plain color.

Parameters:
mColor The color to use
Returns:
The new material

Implements gui::manager_impl.

Definition at line 191 of file gui_gl_manager.cpp.

utils::refptr< gui::material > gui::gl::manager::create_material ( const std::string &  sFileName  )  const [virtual]

Creates a new material from a texture file.

Parameters:
sFileName The name of the file
Returns:
The new material
Note:
Only PNG textures are supported by this implementation (parsed by libpng).

Implements gui::manager_impl.

Definition at line 170 of file gui_gl_manager.cpp.

utils::refptr< gui::render_target > gui::gl::manager::create_render_target ( uint  uiWidth,
uint  uiHeight 
) const [virtual]

Creates a new render target.

Parameters:
uiWidth The width of the render target
uiHeight The height of the render target

Implements gui::manager_impl.

Definition at line 201 of file gui_gl_manager.cpp.

void gui::gl::manager::end (  )  const [virtual]

Ends rendering.

Implements gui::manager_impl.

Definition at line 73 of file gui_gl_manager.cpp.

bool gui::gl::manager::is_gl_extension_supported ( const std::string &  sExtension  )  [static]

Checks if a given OpenGL extension is supported by the machine.

Returns:
'true' if that is the case, 'false' else.

Definition at line 223 of file gui_gl_manager.cpp.

void gui::gl::manager::render_quad ( const quad mQuad  )  const [virtual]

Renders a quad.

Parameters:
mQuad The quad to render on the current render target
Note:
This function is meant to be called between begin() and end() only.

Implements gui::manager_impl.

Definition at line 82 of file gui_gl_manager.cpp.

void gui::gl::manager::render_quads ( const quad mQuad,
const std::vector< std::array< vertex, 4 >> &  lQuadList 
) const [virtual]

Renders a set of quads.

Parameters:
mQuad The base quad to use for rendering (material, blending, ...)
lQuadList The list of the quads you want to render
Note:
This function is meant to be called between begin() and end() only. It is always more efficient to call this method than calling render_quad repeatedly, as it allows to batch count reduction.

Implements gui::manager_impl.

Definition at line 121 of file gui_gl_manager.cpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Tue Jan 1 21:58:13 2013 for gui by  doxygen 1.6.1