GPUVertBuf: Rename GPUVertBuf to VertBuf and add some getters

to avoid more typecasts.
This commit is contained in:
2020-09-06 23:45:51 +02:00
parent 99e3541d3b
commit bb2aeb4504
20 changed files with 359 additions and 166 deletions

View File

@@ -31,6 +31,7 @@
#include "gpu_batch_private.hh"
#include "gl_index_buffer.hh"
#include "gl_vertex_buffer.hh"
#include "glew-mx.h"
@@ -102,10 +103,18 @@ class GLBatch : public Batch {
void bind(int i_first);
/* Convenience getters. */
GLIndexBuf *gl_elem(void)
GLIndexBuf *elem_(void) const
{
return static_cast<GLIndexBuf *>(unwrap(elem));
}
GLVertBuf *verts_(const int index) const
{
return static_cast<GLVertBuf *>(unwrap(verts[index]));
}
GLVertBuf *inst_(const int index) const
{
return static_cast<GLVertBuf *>(unwrap(inst[index]));
}
MEM_CXX_CLASS_ALLOC_FUNCS("GLBatch");
};