zenilib.com

Get Zenipex Library at SourceForge.net. Fast, secure and Free Open Source software downloads
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | Friends
Zeni::Vertex_Buffer Class Reference

A Vertex_Buffer that accepts Triangle and Quadrilaterals. More...

#include <Vertex_Buffer.h>

+ Collaboration diagram for Zeni::Vertex_Buffer:

List of all members.

Classes

class  Uninit
 Lose all Vertex_Buffer objects, presumably when losing resources in Textures and Fonts. More...
struct  Vertex_Buffer_Range

Public Member Functions

 Vertex_Buffer ()
 ~Vertex_Buffer ()
void do_normal_alignment (const bool align_normals_=true)
bool will_do_normal_alignment () const
void give_Triangle (Triangle< Vertex2f_Color > *const &triangle)
 Give the Vertex_Buffer a Triangle (which it will delete later)
void fax_Triangle (const Triangle< Vertex2f_Color > *const &triangle)
 Give the Vertex_Buffer a copy of a Triangle.
void give_Quadrilateral (Quadrilateral< Vertex2f_Color > *const &quadrilateral)
 Give the Vertex_Buffer a Quadrilateral (which it will delete later)
void fax_Quadrilateral (const Quadrilateral< Vertex2f_Color > *const &quadrilateral)
 Give the Vertex_Buffer a copy of a Quadrilateral.
void give_Triangle (Triangle< Vertex2f_Texture > *const &triangle)
 Give the Vertex_Buffer a Triangle (which it will delete later)
void fax_Triangle (const Triangle< Vertex2f_Texture > *const &triangle)
 Give the Vertex_Buffer a copy of a Triangle.
void give_Quadrilateral (Quadrilateral< Vertex2f_Texture > *const &quadrilateral)
 Give the Vertex_Buffer a Quadrilateral (which it will delete later)
void fax_Quadrilateral (const Quadrilateral< Vertex2f_Texture > *const &quadrilateral)
 Give the Vertex_Buffer a copy of a Quadrilateral.
void give_Triangle (Triangle< Vertex3f_Color > *const &triangle)
 Give the Vertex_Buffer a Triangle (which it will delete later)
void fax_Triangle (const Triangle< Vertex3f_Color > *const &triangle)
 Give the Vertex_Buffer a copy of a Triangle.
void give_Quadrilateral (Quadrilateral< Vertex3f_Color > *const &quadrilateral)
 Give the Vertex_Buffer a Quadrilateral (which it will delete later)
void fax_Quadrilateral (const Quadrilateral< Vertex3f_Color > *const &quadrilateral)
 Give the Vertex_Buffer a copy of a Quadrilateral.
void give_Triangle (Triangle< Vertex3f_Texture > *const &triangle)
 Give the Vertex_Buffer a Triangle (which it will delete later)
void fax_Triangle (const Triangle< Vertex3f_Texture > *const &triangle)
 Give the Vertex_Buffer a copy of a Triangle.
void give_Quadrilateral (Quadrilateral< Vertex3f_Texture > *const &quadrilateral)
 Give the Vertex_Buffer a Quadrilateral (which it will delete later)
void fax_Quadrilateral (const Quadrilateral< Vertex3f_Texture > *const &quadrilateral)
 Give the Vertex_Buffer a copy of a Quadrilateral.
void debug_render ()
 Render all Triangles in the Vertex_Buffer individually; Will fail if prerender has been called.
void give_Macrorenderer (Vertex_Buffer_Macrorenderer *const &macrorenderer)
 Wraps the final render call.
void render ()
 Render the Vertex_Buffer.
void lose ()
 Lose the Vertex_Buffer.

Static Public Member Functions

static void lose_all ()

Private Member Functions

 Vertex_Buffer (const Vertex_Buffer &)
Vertex_Bufferoperator= (const Vertex_Buffer &)
void prerender ()
 Create the vertex buffer in the GPU/VPU.
size_t num_vertices_cm () const
size_t num_vertices_t () const
void unprerender ()
 Allow prerender() to be called again.
void sort_triangles ()
void set_descriptors ()
void align_similar_normals ()

Static Private Member Functions

static std::set< Vertex_Buffer * > & get_vbos ()

Private Attributes

std::vector< Triangle
< Vertex3f_Color > * > 
m_triangles_cm
std::vector< Triangle
< Vertex3f_Texture > * > 
m_triangles_t
std::vector
< Vertex_Buffer_Range * > 
m_descriptors_cm
std::vector
< Vertex_Buffer_Range * > 
m_descriptors_t
bool m_align_normals
Vertex_Buffer_Rendererm_renderer
bool m_prerendered
Vertex_Buffer_Macrorendererm_macrorenderer

Static Private Attributes

Zeni::Vertex_Buffer::Uninit g_uninit

Friends

class Vertex_Buffer_Renderer_GL
class Vertex_Buffer_Renderer_DX9

Detailed Description

A Vertex_Buffer that accepts Triangle and Quadrilaterals.

Author:
bazald

Contact: bazald@zenipex.com


Constructor & Destructor Documentation

Zeni::Vertex_Buffer::Vertex_Buffer ( const Vertex_Buffer ) [private]
Zeni::Vertex_Buffer::Vertex_Buffer ( )
Zeni::Vertex_Buffer::~Vertex_Buffer ( )

Member Function Documentation

void Zeni::Vertex_Buffer::align_similar_normals ( ) [private]

Definition at line 414 of file Vertex_Buffer.cpp.

References m_triangles_cm, m_descriptors_cm, m_triangles_t, and m_descriptors_t.

Referenced by prerender().

void Zeni::Vertex_Buffer::debug_render ( )

Render all Triangles in the Vertex_Buffer individually; Will fail if prerender has been called.

Definition at line 229 of file Vertex_Buffer.cpp.

References i, m_triangles_cm, Zeni::get_Video(), Zeni::Video::render(), and m_triangles_t.

void Zeni::Vertex_Buffer::do_normal_alignment ( const bool  align_normals_ = true) [inline]

Definition at line 25 of file Vertex_Buffer.hxx.

References m_align_normals.

Referenced by Zeni::Model_Renderer::create_vertex_buffer().

void Zeni::Vertex_Buffer::fax_Quadrilateral ( const Quadrilateral< Vertex2f_Color > *const &  quadrilateral)
void Zeni::Vertex_Buffer::fax_Quadrilateral ( const Quadrilateral< Vertex2f_Texture > *const &  quadrilateral)
void Zeni::Vertex_Buffer::fax_Quadrilateral ( const Quadrilateral< Vertex3f_Color > *const &  quadrilateral)
void Zeni::Vertex_Buffer::fax_Quadrilateral ( const Quadrilateral< Vertex3f_Texture > *const &  quadrilateral)
void Zeni::Vertex_Buffer::fax_Triangle ( const Triangle< Vertex2f_Color > *const &  triangle)
void Zeni::Vertex_Buffer::fax_Triangle ( const Triangle< Vertex2f_Texture > *const &  triangle)
void Zeni::Vertex_Buffer::fax_Triangle ( const Triangle< Vertex3f_Color > *const &  triangle)

Give the Vertex_Buffer a copy of a Triangle.

Definition at line 173 of file Vertex_Buffer.cpp.

References give_Triangle(), and Zeni::Triangle::get_duplicate().

void Zeni::Vertex_Buffer::fax_Triangle ( const Triangle< Vertex3f_Texture > *const &  triangle)

Give the Vertex_Buffer a copy of a Triangle.

Definition at line 196 of file Vertex_Buffer.cpp.

References give_Triangle(), and Zeni::Triangle::get_duplicate().

std::set< Vertex_Buffer * > & Zeni::Vertex_Buffer::get_vbos ( ) [static, private]

Definition at line 435 of file Vertex_Buffer.cpp.

Referenced by Vertex_Buffer(), ~Vertex_Buffer(), and lose_all().

void Zeni::Vertex_Buffer::give_Macrorenderer ( Vertex_Buffer_Macrorenderer *const &  macrorenderer)

Wraps the final render call.

Definition at line 236 of file Vertex_Buffer.cpp.

References m_macrorenderer.

void Zeni::Vertex_Buffer::give_Quadrilateral ( Quadrilateral< Vertex2f_Color > *const &  quadrilateral)

Give the Vertex_Buffer a Quadrilateral (which it will delete later)

Definition at line 131 of file Vertex_Buffer.cpp.

References fax_Quadrilateral().

void Zeni::Vertex_Buffer::give_Quadrilateral ( Quadrilateral< Vertex2f_Texture > *const &  quadrilateral)

Give the Vertex_Buffer a Quadrilateral (which it will delete later)

Definition at line 144 of file Vertex_Buffer.cpp.

References fax_Quadrilateral().

void Zeni::Vertex_Buffer::give_Quadrilateral ( Quadrilateral< Vertex3f_Color > *const &  quadrilateral)

Give the Vertex_Buffer a Quadrilateral (which it will delete later)

Definition at line 203 of file Vertex_Buffer.cpp.

References fax_Quadrilateral().

void Zeni::Vertex_Buffer::give_Quadrilateral ( Quadrilateral< Vertex3f_Texture > *const &  quadrilateral)

Give the Vertex_Buffer a Quadrilateral (which it will delete later)

Definition at line 216 of file Vertex_Buffer.cpp.

References fax_Quadrilateral().

void Zeni::Vertex_Buffer::give_Triangle ( Triangle< Vertex2f_Color > *const &  triangle)

Give the Vertex_Buffer a Triangle (which it will delete later)

Definition at line 89 of file Vertex_Buffer.cpp.

References fax_Triangle().

Referenced by fax_Quadrilateral(), and fax_Triangle().

void Zeni::Vertex_Buffer::give_Triangle ( Triangle< Vertex2f_Texture > *const &  triangle)

Give the Vertex_Buffer a Triangle (which it will delete later)

Definition at line 110 of file Vertex_Buffer.cpp.

References fax_Triangle().

void Zeni::Vertex_Buffer::give_Triangle ( Triangle< Vertex3f_Color > *const &  triangle)
void Zeni::Vertex_Buffer::give_Triangle ( Triangle< Vertex3f_Texture > *const &  triangle)
void Zeni::Vertex_Buffer::lose ( )

Lose the Vertex_Buffer.

Definition at line 258 of file Vertex_Buffer.cpp.

References m_renderer.

Referenced by unprerender().

void Zeni::Vertex_Buffer::lose_all ( ) [static]

Definition at line 424 of file Vertex_Buffer.cpp.

References get_vbos().

Referenced by Zeni::Vertex_Buffer::Uninit::operator()().

size_t Zeni::Vertex_Buffer::num_vertices_cm ( ) const [inline, private]
size_t Zeni::Vertex_Buffer::num_vertices_t ( ) const [inline, private]
Vertex_Buffer& Zeni::Vertex_Buffer::operator= ( const Vertex_Buffer ) [private]
void Zeni::Vertex_Buffer::prerender ( ) [private]

Create the vertex buffer in the GPU/VPU.

Definition at line 263 of file Vertex_Buffer.cpp.

References m_prerendered, sort_triangles(), set_descriptors(), m_align_normals, and align_similar_normals().

Referenced by render().

void Zeni::Vertex_Buffer::render ( )
void Zeni::Vertex_Buffer::set_descriptors ( ) [private]

Definition at line 419 of file Vertex_Buffer.cpp.

References m_triangles_cm, m_descriptors_cm, m_triangles_t, and m_descriptors_t.

Referenced by prerender().

void Zeni::Vertex_Buffer::sort_triangles ( ) [private]

Definition at line 274 of file Vertex_Buffer.cpp.

References m_triangles_cm, and m_triangles_t.

Referenced by prerender().

void Zeni::Vertex_Buffer::unprerender ( ) [inline, private]

Allow prerender() to be called again.

Definition at line 41 of file Vertex_Buffer.hxx.

References lose(), m_descriptors_cm, m_descriptors_t, and m_prerendered.

Referenced by give_Triangle().

bool Zeni::Vertex_Buffer::will_do_normal_alignment ( ) const [inline]

Definition at line 29 of file Vertex_Buffer.hxx.

References m_align_normals.


Friends And Related Function Documentation

friend class Vertex_Buffer_Renderer_DX9 [friend]

Definition at line 113 of file Vertex_Buffer.h.

friend class Vertex_Buffer_Renderer_GL [friend]

Definition at line 112 of file Vertex_Buffer.h.


Member Data Documentation

Definition at line 850 of file Vertex_Buffer.cpp.

Referenced by Vertex_Buffer(), and ~Vertex_Buffer().

Definition at line 193 of file Vertex_Buffer.h.

Referenced by do_normal_alignment(), will_do_normal_alignment(), and prerender().

Definition at line 196 of file Vertex_Buffer.h.

Referenced by unprerender(), and prerender().

Definition at line 195 of file Vertex_Buffer.h.

Referenced by ~Vertex_Buffer(), render(), and lose().


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