Loading...
Searching...
No Matches
hellfire::Mesh Class Reference

#include <Mesh.h>

Collaboration diagram for hellfire::Mesh:

Public Member Functions

 Mesh ()
 
 Mesh (const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices)
 
 Mesh (const std::vector< Vertex > &vertices, const std::vector< unsigned int > &indices, bool defer_build)
 
void cleanup ()
 
void bind () const
 
void unbind () const
 
void build ()
 
bool is_built () const
 
void draw () const
 
void draw_instanced (size_t amount) const
 
int get_index_count () const
 

Public Attributes

std::vector< Vertexvertices
 
std::vector< unsigned int > indices
 
bool is_wireframe = false
 

Private Member Functions

void create_mesh ()
 

Private Attributes

std::unique_ptr< VAvao_ = nullptr
 
std::unique_ptr< VBvbo_ = nullptr
 
std::unique_ptr< IBibo_ = nullptr
 
int index_count_
 

Detailed Description

Definition at line 9 of file Mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/3]

hellfire::Mesh::Mesh ( )

Definition at line 8 of file Mesh.cpp.

◆ Mesh() [2/3]

hellfire::Mesh::Mesh ( const std::vector< Vertex > &  vertices,
const std::vector< unsigned int > &  indices 
)

Definition at line 11 of file Mesh.cpp.

◆ Mesh() [3/3]

hellfire::Mesh::Mesh ( const std::vector< Vertex > &  vertices,
const std::vector< unsigned int > &  indices,
bool  defer_build 
)

Definition at line 16 of file Mesh.cpp.

Member Function Documentation

◆ bind()

void hellfire::Mesh::bind ( ) const

Definition at line 22 of file Mesh.cpp.

◆ build()

void hellfire::Mesh::build ( )

Definition at line 30 of file Mesh.cpp.

◆ cleanup()

void hellfire::Mesh::cleanup ( )

◆ create_mesh()

void hellfire::Mesh::create_mesh ( )
private

Definition at line 34 of file Mesh.cpp.

◆ draw()

void hellfire::Mesh::draw ( ) const

Definition at line 83 of file Mesh.cpp.

◆ draw_instanced()

void hellfire::Mesh::draw_instanced ( size_t  amount) const

Definition at line 89 of file Mesh.cpp.

◆ get_index_count()

int hellfire::Mesh::get_index_count ( ) const

Definition at line 96 of file Mesh.cpp.

◆ is_built()

bool hellfire::Mesh::is_built ( ) const
inline

Definition at line 26 of file Mesh.h.

◆ unbind()

void hellfire::Mesh::unbind ( ) const

Definition at line 26 of file Mesh.cpp.

Member Data Documentation

◆ ibo_

std::unique_ptr<IB> hellfire::Mesh::ibo_ = nullptr
private

Definition at line 43 of file Mesh.h.

◆ index_count_

int hellfire::Mesh::index_count_
private

Definition at line 45 of file Mesh.h.

◆ indices

std::vector<unsigned int> hellfire::Mesh::indices

Definition at line 30 of file Mesh.h.

◆ is_wireframe

bool hellfire::Mesh::is_wireframe = false

Definition at line 32 of file Mesh.h.

◆ vao_

std::unique_ptr<VA> hellfire::Mesh::vao_ = nullptr
private

Definition at line 41 of file Mesh.h.

◆ vbo_

std::unique_ptr<VB> hellfire::Mesh::vbo_ = nullptr
private

Definition at line 42 of file Mesh.h.

◆ vertices

std::vector<Vertex> hellfire::Mesh::vertices

Definition at line 29 of file Mesh.h.


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