JMGraphics
Loading...
Searching...
No Matches
JMGraphics::Mesh Class Reference

Object that contains and can render mesh data. More...

#include <JMGraphics.h>

Classes

struct  Vertex

Public Member Functions

 Mesh (JMGraphics *Parent)
void display ()
 Renders the mesh using the parent graphics object.
void process ()
JMGraphics::Meshclone () const
 Mesh (const Mesh &)=delete
Mesh & operator= (const Mesh &)=delete
 Mesh (Mesh &&)=default
Mesh & operator= (Mesh &&)=default
void writeData (std::ostream &stream)
 Writes all vertex and index data to a stream. Stream must be set up correctly for binary writing.
void readData (std::istream &stream)
 Reads all vertex and index data from a stream.

Static Public Member Functions

static void readData (std::istream &stream, std::vector< JMGraphics::Mesh::Vertex > &verts, std::vector< unsigned int > &indices)
 Reads all vertex and index data from a stream and stores them in the given vectors.

Public Attributes

std::vector< Vertexvertices
std::vector< unsigned int > indices
std::vector< Texturetextures
std::string name = "Mesh"
glm::vec4 wireframeColor = glm::vec4(0.0f, 0.3f, 1.0f, 1.0f)
JMGraphicsparent = nullptr
bool renderWireframe = false
bool renderFaces = true
bool reProcess = false

Detailed Description

Object that contains and can render mesh data.

Member Function Documentation

◆ process()

void JMGraphics::Mesh::process ( )

Sends the mesh data to the gpu. Must call this after manualy modifying verts if you want it to render correctly. Only call when the parent context or a shared context is current. If not, set the reProcess flag to true and the mesh will be processed the next time display is called.


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