#include <GlMesh.hpp>

Public Member Functions

 GlMesh ()
 
void CreateMesh (Context const *logger)
 
void Load_Positions (Context const *logger, float const *data, size_t length)
 Uses 3 floats per vertex (XYZ). length Number of floats. More...
 
void Load_TexCoords (Context const *logger, float const *data, size_t length)
 Uses 2 floats per vertex (UV). length Number of floats. More...
 
void Load_Indices (Context const *logger, GLuint const *data, size_t length, GLenum draw_mode)
 Uses 1 unsigned per index (index id). Use value GLuint( -1 ) for primitive restart. length numbef or indices. More...
 
void Load_All (Context const *logger, GlMeshData const &data)
 Can be used instead of Load_* methods. More...
 
void DestroyMesh (Context const *logger)
 
void DropMesh (Context const *logger)
 
void DrawElements (Context const *logger) const
 
size_t indices_cnt () const
 

Static Public Attributes

static const constexpr GLuint PrimitiveRestart = (GLuint)-1
 
static const constexpr GLuint AttributeLoc_Position = 0
 
static const constexpr GLuint AttributeLoc_Texcoord = 1
 

Detailed Description

Definition at line 18 of file GlMesh.hpp.

Constructor & Destructor Documentation

◆ GlMesh()

iv::GlMesh::GlMesh ( )

Definition at line 9 of file GlMesh.cpp.

Member Function Documentation

◆ CreateMesh()

void iv::GlMesh::CreateMesh ( Context const *  logger)

Definition at line 34 of file GlMesh.cpp.

◆ Load_Positions()

void iv::GlMesh::Load_Positions ( Context const *  logger,
float const *  data,
size_t  length 
)

Uses 3 floats per vertex (XYZ). length Number of floats.

Definition at line 42 of file GlMesh.cpp.

◆ Load_TexCoords()

void iv::GlMesh::Load_TexCoords ( Context const *  logger,
float const *  data,
size_t  length 
)

Uses 2 floats per vertex (UV). length Number of floats.

Definition at line 69 of file GlMesh.cpp.

◆ Load_Indices()

void iv::GlMesh::Load_Indices ( Context const *  logger,
GLuint const *  data,
size_t  length,
GLenum  draw_mode 
)

Uses 1 unsigned per index (index id). Use value GLuint( -1 ) for primitive restart. length numbef or indices.

Definition at line 96 of file GlMesh.cpp.

◆ Load_All()

void iv::GlMesh::Load_All ( Context const *  logger,
GlMeshData const &  data 
)

Can be used instead of Load_* methods.

Definition at line 22 of file GlMesh.cpp.

◆ DestroyMesh()

void iv::GlMesh::DestroyMesh ( Context const *  logger)

Definition at line 162 of file GlMesh.cpp.

◆ DropMesh()

void iv::GlMesh::DropMesh ( Context const *  logger)

Definition at line 202 of file GlMesh.cpp.

◆ DrawElements()

void iv::GlMesh::DrawElements ( Context const *  logger) const

This just enables VAO and calls glDrawElements. Shader program with uniforms and textures is expected to be enabled when this is called.

Definition at line 215 of file GlMesh.cpp.

◆ indices_cnt()

size_t iv::GlMesh::indices_cnt ( ) const

Definition at line 29 of file GlMesh.cpp.

Member Data Documentation

◆ PrimitiveRestart

const constexpr GLuint iv::GlMesh::PrimitiveRestart = (GLuint)-1
staticconstexpr

Definition at line 21 of file GlMesh.hpp.

◆ AttributeLoc_Position

const constexpr GLuint iv::GlMesh::AttributeLoc_Position = 0
staticconstexpr

Definition at line 23 of file GlMesh.hpp.

◆ AttributeLoc_Texcoord

const constexpr GLuint iv::GlMesh::AttributeLoc_Texcoord = 1
staticconstexpr

Definition at line 24 of file GlMesh.hpp.


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