Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
Public Member Functions | Private Attributes | List of all members
blowbox::Mesh Class Reference

#include <mesh.h>

Public Member Functions

void Create (const MeshData &mesh)
 
void Destroy ()
 
const MeshDataGetMeshData () const
 
const StructuredBufferGetVertexBuffer () const
 
const ByteAddressBufferGetIndexBuffer () const
 

Private Attributes

bool initialized_
 
MeshData mesh_data_
 
StructuredBuffer vertex_buffer_
 
ByteAddressBuffer index_buffer_
 

Detailed Description

A mesh that can be rendered.

This class creates the appropriate buffers for a MeshData. The renderers in Blowbox expect this object. It is usually stored by Entity objects, but you can also keep it seperately, although there isn't much you can do with it by yourself.

Member Function Documentation

void blowbox::Mesh::Create ( const MeshData mesh)

Creates the buffers for a given MeshData.

Parameters
[in]meshThe mesh data that should be used to construct this Mesh.
Remarks
You can call Create() multiple times on a Mesh. It will destruct any buffers that might have previously been alive.
void blowbox::Mesh::Destroy ( )

Destroys all buffers held in the Mesh.

const ByteAddressBuffer & blowbox::Mesh::GetIndexBuffer ( ) const
Returns
A ByteAddressBuffer that has all index data in it for this Mesh.
const MeshData & blowbox::Mesh::GetMeshData ( ) const
Returns
The MeshData that was used to construct this Mesh.
const StructuredBuffer & blowbox::Mesh::GetVertexBuffer ( ) const
Returns
A StructuredBuffer that has all vertex data in it for this Mesh.

Member Data Documentation

ByteAddressBuffer blowbox::Mesh::index_buffer_
private

A ByteAddressBuffer that has all index data in it for this Mesh.

bool blowbox::Mesh::initialized_
private

Whether the Mesh has been initialized yet.

MeshData blowbox::Mesh::mesh_data_
private

The MeshData that was used to construct this Mesh.

StructuredBuffer blowbox::Mesh::vertex_buffer_
private

A StructuredBuffer that has all vertex data in it for this Mesh.


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