SolarSim
Loading...
Searching...
No Matches
solarsim::Mesh Struct Reference

Represents 3D geometry with OpenGL buffers. More...

#include <mesh.hpp>

Public Member Functions

void setupBuffers ()
 Initialize OpenGL buffers and vertex attributes.

Data Fields

uint32_t vao = 0
uint32_t vbo = 0
uint32_t ebo = 0
uint32_t vertexCount = 0
GLenum drawMode = GL_TRIANGLES
bool useElements = false
bool useNormals = true
std::vector< float > vertices
std::vector< uint32_t > indices

Detailed Description

Represents 3D geometry with OpenGL buffers.

Note
Handles both vertex array and buffer object management
Warning
Call setupBuffers() before rendering to initialize OpenGL state

Member Function Documentation

◆ setupBuffers()

void solarsim::Mesh::setupBuffers ( )
inline

Initialize OpenGL buffers and vertex attributes.

Note
Creates VAO, VBO, and optionally EBO
Warning
Must be called with active OpenGL context

Field Documentation

◆ drawMode

GLenum solarsim::Mesh::drawMode = GL_TRIANGLES

OpenGL primitive type for the type of geometry to draw

◆ ebo

uint32_t solarsim::Mesh::ebo = 0

Element buffer object handle

◆ indices

std::vector<uint32_t> solarsim::Mesh::indices

Vertex indicdes for indexed rendering

◆ useElements

bool solarsim::Mesh::useElements = false

Whether to use index buffer

◆ useNormals

bool solarsim::Mesh::useNormals = true

Whether vertices include normals

◆ vao

uint32_t solarsim::Mesh::vao = 0

Vertex array object handle

◆ vbo

uint32_t solarsim::Mesh::vbo = 0

Vertex buffer object handle

◆ vertexCount

uint32_t solarsim::Mesh::vertexCount = 0

Number of vertices in the mesh

◆ vertices

std::vector<float> solarsim::Mesh::vertices

Raw vertex data


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