RunicVTT Open Source Virtual Tabletop for TTRPG using P2P
Loading...
Searching...
No Matches
VertexBufferLayout Class Reference

#include <VertexBufferLayout.h>

Collaboration diagram for VertexBufferLayout:

Public Member Functions

 VertexBufferLayout ()
 
template<typename T >
void Push (unsigned int count)
 
template<>
void Push (unsigned int count)
 
template<>
void Push (unsigned int count)
 
template<>
void Push (unsigned int count)
 
const std::vector< VertexBufferElementGetElements () const
 
unsigned int GetStride () const
 

Private Attributes

std::vector< VertexBufferElementm_Elements
 
unsigned int m_Stride
 

Detailed Description

Definition at line 30 of file VertexBufferLayout.h.

Constructor & Destructor Documentation

◆ VertexBufferLayout()

VertexBufferLayout::VertexBufferLayout ( )
inline

Definition at line 37 of file VertexBufferLayout.h.

37 :
38 m_Stride(0) {};

Member Function Documentation

◆ GetElements()

const std::vector< VertexBufferElement > VertexBufferLayout::GetElements ( ) const
inline

Definition at line 70 of file VertexBufferLayout.h.

71 {
72 return m_Elements;
73 };
std::vector< VertexBufferElement > m_Elements

◆ GetStride()

unsigned int VertexBufferLayout::GetStride ( ) const
inline

Definition at line 74 of file VertexBufferLayout.h.

75 {
76 return m_Stride;
77 };

◆ Push() [1/4]

template<typename T >
void VertexBufferLayout::Push ( unsigned int count)
inline

Definition at line 41 of file VertexBufferLayout.h.

42 {
43 std::runtime_error(false);
44 }
Here is the caller graph for this function:

◆ Push() [2/4]

template<>
void VertexBufferLayout::Push ( unsigned int count)
inline

Definition at line 47 of file VertexBufferLayout.h.

48 {
49 VertexBufferElement vbe = {GL_FLOAT, count, GL_FALSE};
50 m_Elements.push_back(vbe);
52 }
static unsigned int GetSizeOfType(unsigned int type)
Here is the call graph for this function:

◆ Push() [3/4]

template<>
void VertexBufferLayout::Push ( unsigned int count)
inline

Definition at line 55 of file VertexBufferLayout.h.

56 {
57 VertexBufferElement vbe = {GL_UNSIGNED_INT, count, GL_FALSE};
58 m_Elements.push_back(vbe);
59 m_Stride += count * VertexBufferElement::GetSizeOfType(GL_UNSIGNED_INT);
60 }
Here is the call graph for this function:

◆ Push() [4/4]

template<>
void VertexBufferLayout::Push ( unsigned int count)
inline

Definition at line 63 of file VertexBufferLayout.h.

64 {
65 VertexBufferElement vbe = {GL_UNSIGNED_BYTE, count, GL_TRUE};
66 m_Elements.push_back(vbe);
67 m_Stride += count * VertexBufferElement::GetSizeOfType(GL_UNSIGNED_BYTE);
68 }
Here is the call graph for this function:

Member Data Documentation

◆ m_Elements

std::vector<VertexBufferElement> VertexBufferLayout::m_Elements
private

Definition at line 33 of file VertexBufferLayout.h.

◆ m_Stride

unsigned int VertexBufferLayout::m_Stride
private

Definition at line 34 of file VertexBufferLayout.h.


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