GPUVertBuf: Make GPUVertBuf private to the GPU module

This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
This commit is contained in:
2020-09-06 16:40:07 +02:00
parent 98fc3f263c
commit 7ffff04e49
24 changed files with 211 additions and 116 deletions

View File

@@ -141,11 +141,12 @@ static PyObject *bpygpu_Batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_b
return NULL;
}
if (self->batch->verts[0]->vertex_len != py_buf->buf->vertex_len) {
if (GPU_vertbuf_get_vertex_len(self->batch->verts[0]) !=
GPU_vertbuf_get_vertex_len(py_buf->buf)) {
PyErr_Format(PyExc_TypeError,
"Expected %d length, got %d",
self->batch->verts[0]->vertex_len,
py_buf->buf->vertex_len);
GPU_vertbuf_get_vertex_len(self->batch->verts[0]),
GPU_vertbuf_get_vertex_len(py_buf->buf));
return NULL;
}