Practical Tools for Simple Design
Loading...
Searching...
No Matches
Core::VertexArray Class Reference

Wrapper for OpenGL Vertex Array Object. More...

#include <VertexArray.hpp>

Public Member Functions

 VertexArray ()
 VertexArray (const VertexArray &)=delete
 VertexArray (VertexArray &&other)
VertexArrayoperator= (const VertexArray &)=delete
VertexArrayoperator= (VertexArray &&other)
void Bind () const
void Unbind () const
void AddVertexBuffer (std::unique_ptr< VertexBuffer > vertexBuffer)
void SetIndexBuffer (std::unique_ptr< IndexBuffer > indexBuffer)
void DrawTriangles () const

Detailed Description

Wrapper for OpenGL Vertex Array Object.

Constructor & Destructor Documentation

◆ VertexArray()

Core::VertexArray::VertexArray ( )

I dislike the way VertexBuffer and IndexBuffer are handled here. This breaks RAII principles

TODO: Maybe find an alternative solution

Member Function Documentation

◆ SetIndexBuffer()

void Core::VertexArray::SetIndexBuffer ( std::unique_ptr< IndexBuffer > indexBuffer)

Index buffer must be set or else there will be a segfault


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