summaryrefslogtreecommitdiff
path: root/game/vehicles/railVehicleClass.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2026-03-07 12:32:55 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2026-03-07 14:17:44 +0000
commit4420f20a901ed1f96d9fb8f4df0148bc0bc3666d (patch)
treeb6484d3a75acb1c9461707d2c7168fa5b652b15c /game/vehicles/railVehicleClass.cpp
parentDon't create and then replace shadow and billboard textures (diff)
downloadilt-4420f20a901ed1f96d9fb8f4df0148bc0bc3666d.tar.bz2
ilt-4420f20a901ed1f96d9fb8f4df0148bc0bc3666d.tar.xz
ilt-4420f20a901ed1f96d9fb8f4df0148bc0bc3666d.zip
Add glVertexArray useBuffer
Wraps glVertexArrayVertexBuffer automatically getting the buffer name from the argument and deriving the stride from the container's value_type.
Diffstat (limited to 'game/vehicles/railVehicleClass.cpp')
-rw-r--r--game/vehicles/railVehicleClass.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/game/vehicles/railVehicleClass.cpp b/game/vehicles/railVehicleClass.cpp
index 100073d..2bdd7c4 100644
--- a/game/vehicles/railVehicleClass.cpp
+++ b/game/vehicles/railVehicleClass.cpp
@@ -52,10 +52,9 @@ RailVehicleClass::render(const SceneShader & shader, const Frustum &) const
texture->bind();
}
shader.basicInst.use();
- const auto instancesBuffer = instances.bufferName();
- glVertexArrayVertexBuffer(instanceVAO, 1, instancesBuffer, 0, sizeof(LocationVertex));
- glVertexArrayVertexBuffer(instancesBogiesVAO.front(), 1, instancesBuffer, 0, sizeof(LocationVertex));
- glVertexArrayVertexBuffer(instancesBogiesVAO.back(), 1, instancesBuffer, 0, sizeof(LocationVertex));
+ instanceVAO.useBuffer(1, instances);
+ instancesBogiesVAO.front().useBuffer(1, instances);
+ instancesBogiesVAO.back().useBuffer(1, instances);
bodyMesh->DrawInstanced(instanceVAO, count);
bogies.front()->DrawInstanced(instancesBogiesVAO.front(), count);
bogies.back()->DrawInstanced(instancesBogiesVAO.back(), count);