vengine  0.1.0
3D graphics engine made with Vulkan
Loading...
Searching...
No Matches
ven::Model Class Reference

#include <Model.hpp>

+ Collaboration diagram for ven::Model:

Classes

struct  Builder
 
struct  Vertex
 

Public Member Functions

 Model (Device &device, const Builder &builder)
 
 ~Model ()
 
 Model (const Model &)=delete
 
void operator= (const Model &)=delete
 
void bind (VkCommandBuffer commandBuffer) const
 
void draw (VkCommandBuffer commandBuffer) const
 

Static Public Member Functions

static std::unique_ptr< ModelcreateModelFromFile (Device &device, const std::string &filename)
 

Private Member Functions

void createVertexBuffer (const std::vector< Vertex > &vertices)
 
void createIndexBuffer (const std::vector< uint32_t > &indices)
 

Private Attributes

Devicem_device
 
std::unique_ptr< Bufferm_vertexBuffer
 
uint32_t m_vertexCount
 
bool m_hasIndexBuffer {false}
 
std::unique_ptr< Bufferm_indexBuffer
 
uint32_t m_indexCount
 

Detailed Description

Definition at line 16 of file Model.hpp.

Constructor & Destructor Documentation

◆ Model() [1/2]

ven::Model::Model ( Device & device,
const Builder & builder )

Definition at line 25 of file model.cpp.

References createIndexBuffer(), createVertexBuffer(), ven::Model::Builder::indices, and ven::Model::Builder::vertices.

+ Here is the call graph for this function:

◆ ~Model()

ven::Model::~Model ( )
default

◆ Model() [2/2]

ven::Model::Model ( const Model & )
delete

Member Function Documentation

◆ bind()

void ven::Model::bind ( VkCommandBuffer commandBuffer) const

Definition at line 81 of file model.cpp.

◆ createIndexBuffer()

void ven::Model::createIndexBuffer ( const std::vector< uint32_t > & indices)
private

Definition at line 50 of file model.cpp.

References ven::Buffer::map().

Referenced by Model().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createModelFromFile()

std::unique_ptr< ven::Model > ven::Model::createModelFromFile ( Device & device,
const std::string & filename )
static

Definition at line 92 of file model.cpp.

References ven::Model::Builder::loadModel().

Referenced by ven::Engine::loadObjects().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createVertexBuffer()

void ven::Model::createVertexBuffer ( const std::vector< Vertex > & vertices)
private

Definition at line 33 of file model.cpp.

References ven::Buffer::map().

Referenced by Model().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ draw()

void ven::Model::draw ( VkCommandBuffer commandBuffer) const

Definition at line 72 of file model.cpp.

◆ operator=()

void ven::Model::operator= ( const Model & )
delete

Member Data Documentation

◆ m_device

Device& ven::Model::m_device
private

Definition at line 57 of file Model.hpp.

◆ m_hasIndexBuffer

bool ven::Model::m_hasIndexBuffer {false}
private

Definition at line 61 of file Model.hpp.

◆ m_indexBuffer

std::unique_ptr<Buffer> ven::Model::m_indexBuffer
private

Definition at line 62 of file Model.hpp.

◆ m_indexCount

uint32_t ven::Model::m_indexCount
private

Definition at line 63 of file Model.hpp.

◆ m_vertexBuffer

std::unique_ptr<Buffer> ven::Model::m_vertexBuffer
private

Definition at line 58 of file Model.hpp.

◆ m_vertexCount

uint32_t ven::Model::m_vertexCount
private

Definition at line 59 of file Model.hpp.


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