Game of Ur 0.3.3
This is a computer adaptation of Game of Ur, written in C++ mainly using SDL and OpenGL.
Loading...
Searching...
No Matches
ToyMaker::BuiltinModelMatrixAllocator Class Reference

An instance allocator initialized with the built in model matrix layout object. More...

#include <instance.hpp>

Inheritance diagram for ToyMaker::BuiltinModelMatrixAllocator:
ToyMaker::BaseInstanceAllocator

Public Member Functions

 BuiltinModelMatrixAllocator (std::vector< glm::mat4 > modelMatrices)
 
- Public Member Functions inherited from ToyMaker::BaseInstanceAllocator
 BaseInstanceAllocator (const InstanceLayout &instanceLayout)
 Construct a new base instance allocator object.
 
 BaseInstanceAllocator (BaseInstanceAllocator &&other)=delete
 
 BaseInstanceAllocator (const BaseInstanceAllocator &other)=delete
 
BaseInstanceAllocatoroperator= (BaseInstanceAllocator &&other)=delete
 
BaseInstanceAllocatoroperator= (const BaseInstanceAllocator &other)=delete
 
virtual ~BaseInstanceAllocator ()
 Destroys the allocator object.
 
InstanceLayout getInstanceLayout () const
 Gets the instance attribute layout for this object.
 
void bind (const InstanceLayout &shaderInstanceLayout)
 Binds a (subset of) this object's instance attributes to the currently active shader.
 
void unbind ()
 Unbinds this object's instance attributes.
 
bool isUploaded ()
 Tests whether the attribute data associated with this allocator has been uploaded to memory.
 

Protected Member Functions

virtual void upload () override
 Uploads this object's attribute data to GPU memory.
 

Private Attributes

std::vector< glm::mat4 > mModelMatrices
 

Additional Inherited Members

- Protected Attributes inherited from ToyMaker::BaseInstanceAllocator
GLuint mVertexBufferIndex {0}
 The OpenGL handle associated with the buffer that this object's instance data has been storerd on.
 

Detailed Description

An instance allocator initialized with the built in model matrix layout object.

See also
BuiltinModelMatrixLayout
Todo
I think a generalization of BuiltinModelMatrixAllocator::upload() is possible and should be explored at some point.

Member Function Documentation

◆ upload()

void BuiltinModelMatrixAllocator::upload ( )
overrideprotectedvirtual

Uploads this object's attribute data to GPU memory.

Implements ToyMaker::BaseInstanceAllocator.


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