Rocket::Core::Geometry Class Reference

#include <Geometry.h>

Collaboration diagram for Rocket::Core::Geometry:

Public Member Functions

 Geometry (Element *host_element=NULL)
 Geometry (Context *host_context)
void SetHostElement (Element *host_element)
void Render (const Vector2f &translation)
std::vector< Vertex > & GetVertices ()
std::vector< int > & GetIndices ()
const TextureGetTexture () const
void SetTexture (const Texture *texture)
 Sets the geometry's texture.
void Release (bool clear_buffers=false)

Detailed Description

A helper object for holding an array of vertices and indices, and compiling it as necessary when rendered.

Author:
Peter Curry

Member Function Documentation

void Rocket::Core::Geometry::SetHostElement ( Element host_element  ) 

Set the host element for this geometry; this should be passed in the constructor if possible.

Parameters:
[in] host_element The new host element for the geometry.

void Rocket::Core::Geometry::Render ( const Vector2f translation  ) 

Attempts to compile the geometry if appropriate, then renders the geometry, compiled if it can.

Parameters:
[in] translation The translation of the geometry.

std::vector< Vertex > & Rocket::Core::Geometry::GetVertices (  ) 

Returns the geometry's vertices. If these are written to, Release() should be called to force a recompile.

Returns:
The geometry's vertex array.

std::vector< int > & Rocket::Core::Geometry::GetIndices (  ) 

Returns the geometry's indices. If these are written to, Release() should be called to force a recompile.

Returns:
The geometry's index array.

const Texture * Rocket::Core::Geometry::GetTexture (  )  const

Gets the geometry's texture.

Returns:
The geometry's texture.

void Rocket::Core::Geometry::Release ( bool  clear_buffers = false  ) 

Releases any previously-compiled geometry, and forces any new geometry to have a compile attempted.

Parameters:
[in] clear_buffers True to also clear the vertex and index buffers, false to leave intact.


The documentation for this class was generated from the following files:
  • Include/Rocket/Core/Geometry.h
  • Source/Core/Geometry.cpp