summaryrefslogtreecommitdiff
path: root/game/scenary
diff options
context:
space:
mode:
Diffstat (limited to 'game/scenary')
-rw-r--r--game/scenary/foliage.cpp9
-rw-r--r--game/scenary/illuminator.cpp17
2 files changed, 12 insertions, 14 deletions
diff --git a/game/scenary/foliage.cpp b/game/scenary/foliage.cpp
index 0981ffc..49a4831 100644
--- a/game/scenary/foliage.cpp
+++ b/game/scenary/foliage.cpp
@@ -4,7 +4,6 @@
#include "gfx/gl/sceneShader.h"
#include "gfx/gl/shadowMapper.h"
#include "gfx/gl/shadowStenciller.h"
-#include "gfx/gl/vertexArrayObject.h"
#include <location.h>
static_assert(std::is_constructible_v<Foliage>);
@@ -38,11 +37,11 @@ void
Foliage::postLoad()
{
texture = getTexture();
- bodyMesh->configureVAO(instanceVAO)
+ bodyMesh->configureVAO(instanceVAO, 0)
.addAttribs<LocationVertex, &LocationVertex::rotation, &LocationVertex::position>(
- instances.bufferName(), 1);
- VertexArrayObject {instancePointVAO}.addAttribs<LocationVertex, &LocationVertex::position, &LocationVertex::yaw>(
- instances.bufferName());
+ 1, instances.bufferName());
+ instancePointVAO.configure().addAttribs<LocationVertex, &LocationVertex::position, &LocationVertex::yaw>(
+ 0, instances.bufferName());
const auto & size = bodyMesh->getDimensions().size;
billboardSize = billboardTextureSizeForObject(size);
diff --git a/game/scenary/illuminator.cpp b/game/scenary/illuminator.cpp
index d8e4c4e..590062e 100644
--- a/game/scenary/illuminator.cpp
+++ b/game/scenary/illuminator.cpp
@@ -1,6 +1,5 @@
#include "illuminator.h"
#include "gfx/gl/sceneShader.h"
-#include "gfx/gl/vertexArrayObject.h"
#include "gfx/models/texture.h" // IWYU pragma: keep
#include <location.h>
@@ -41,15 +40,15 @@ Illuminator::postLoad()
throw std::logic_error {"Illuminator has no lights"};
}
texture = getTexture();
- bodyMesh->configureVAO(instanceVAO)
- .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(instances.bufferName(), 1);
+ bodyMesh->configureVAO(instanceVAO, 0)
+ .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1, instances.bufferName());
if (!spotLight.empty()) {
instancesSpotLightVAO.emplace();
- VertexArrayObject {*instancesSpotLightVAO}
+ instancesSpotLightVAO->configure()
.addAttribs<SpotLightVertex, &SpotLightVertex::position, &SpotLightVertex::direction,
&SpotLightVertex::colour, &SpotLightVertex::kq, &SpotLightVertex::arc>(
- instancesSpotLight.bufferName(), 0)
- .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(instances.bufferName(), 1);
+ 0, instancesSpotLight.bufferName())
+ .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1, instances.bufferName());
std::transform(
spotLight.begin(), spotLight.end(), std::back_inserter(spotLightInstances), [this](const auto & s) {
return instancesSpotLight.acquire(*s);
@@ -57,10 +56,10 @@ Illuminator::postLoad()
}
if (!pointLight.empty()) {
instancesPointLightVAO.emplace();
- VertexArrayObject {*instancesPointLightVAO}
+ instancesPointLightVAO->configure()
.addAttribs<PointLightVertex, &PointLightVertex::position, &PointLightVertex::colour,
- &PointLightVertex::kq>(instancesPointLight.bufferName(), 0)
- .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(instances.bufferName(), 1);
+ &PointLightVertex::kq>(0, instancesPointLight.bufferName())
+ .addAttribs<LocationVertex, &LocationVertex::first, &LocationVertex::second>(1, instances.bufferName());
std::transform(
pointLight.begin(), pointLight.end(), std::back_inserter(pointLightInstances), [this](const auto & s) {
return instancesPointLight.acquire(*s);