Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Mesh.h File Reference

GPU mesh: Vertex Array Object wrapping a VBO and optional EBO. More...

#include <memory>
#include <vector>
#include "Types.h"
#include "graphics/GLForward.h"
#include "graphics/VertexLayout.h"
+ Include dependency graph for Mesh.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  mnd::Mesh
 Immutable GPU mesh (VAO + VBO + optional EBO). More...
 

Namespaces

namespace  mnd
 

Detailed Description

GPU mesh: Vertex Array Object wrapping a VBO and optional EBO.

A Mesh holds the GPU-side geometry for a drawable object. It is created by Builder factory methods (or Mesh::CreateCube) and stored in a shared_ptr so that multiple MeshComponents can share the same geometry data.

Relationship with Material

Mesh and Material are intentionally decoupled — they are paired only at submit time inside a RenderCommand. This allows one mesh to be drawn with different materials (e.g. a highlight variant) without duplication.

Draw call flow

graphicsAPI.BindMesh(mesh); // glBindVertexArray → sets up attrib pointers
mesh->Draw(); // glDrawElements or glDrawArrays
std::shared_ptr< Mesh > mesh
See also
Builder, MeshComponent, RenderCommand

Definition in file Mesh.h.