summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-01-02 18:51:45 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-01-02 18:51:45 +0000
commit9db7798b7c5f4c0f4cf2e8987258755bb1a7c4e8 (patch)
treeb99ab7f2c40452f10309922718dd8c9e9c0f64ba /gfx
parentUse VertexArrayObject for SceneRenderer (diff)
downloadilt-9db7798b7c5f4c0f4cf2e8987258755bb1a7c4e8.tar.bz2
ilt-9db7798b7c5f4c0f4cf2e8987258755bb1a7c4e8.tar.xz
ilt-9db7798b7c5f4c0f4cf2e8987258755bb1a7c4e8.zip
Use VertexArrayObject for SceneShader::PointLight
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/sceneShader.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/gfx/gl/sceneShader.cpp b/gfx/gl/sceneShader.cpp
index a02d955..d0b26c8 100644
--- a/gfx/gl/sceneShader.cpp
+++ b/gfx/gl/sceneShader.cpp
@@ -9,6 +9,7 @@
#include <gfx/gl/shaders/vs-landmassShader.h>
#include <gfx/gl/shaders/vs-pointLight.h>
#include <gfx/gl/shaders/vs-waterShader.h>
+#include <gfx/gl/vertexArrayObject.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/transform.hpp>
#include <location.hpp>
@@ -80,13 +81,7 @@ SceneShader::WaterProgram::use(float waveCycle) const
SceneShader::PointLightShader::PointLightShader() :
SceneProgram {pointLight_vs, pointLight_gs, pointLight_fs}, colourLoc {*this, "colour"}, kqLoc {*this, "kq"}
{
- glBindVertexArray(va);
- glBindBuffer(GL_ARRAY_BUFFER, b);
- glBufferData(GL_ARRAY_BUFFER, sizeof(glm::vec3), nullptr, GL_DYNAMIC_DRAW);
- glEnableVertexAttribArray(0);
- glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(glm::vec3), nullptr);
- glBindBuffer(GL_ARRAY_BUFFER, 0);
- glBindVertexArray(0);
+ VertexArrayObject<glm::vec3>::configure(va, b);
}
void