[core] add getResource template to gfx::*Resource classes

This commit is contained in:
Konstantin Käfer
2019-04-02 22:47:24 +02:00
parent c02010ab6c
commit ebd8508032
20 changed files with 117 additions and 74 deletions

View File

@@ -9,7 +9,7 @@ void VertexArray::bind(Context& context,
const gfx::IndexBuffer& indexBuffer,
const AttributeBindingArray& bindings) {
context.bindVertexArray = state->vertexArray;
state->indexBuffer = reinterpret_cast<const gl::IndexBufferResource&>(*indexBuffer.resource).buffer;
state->indexBuffer = indexBuffer.getResource<gl::IndexBufferResource>().buffer;
state->bindings.reserve(bindings.size());
for (AttributeLocation location = 0; location < bindings.size(); ++location) {