summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-03 18:25:28 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-03 18:25:28 +0000
commitf848ad0e672d913c36fcb86533cbc11a9cf9d9ea (patch)
treee8384bdb074a4e3e53fd9a218b9d9910e6a8256d /gfx
parentTidied Scene Renderer (diff)
downloadilt-f848ad0e672d913c36fcb86533cbc11a9cf9d9ea.tar.bz2
ilt-f848ad0e672d913c36fcb86533cbc11a9cf9d9ea.tar.xz
ilt-f848ad0e672d913c36fcb86533cbc11a9cf9d9ea.zip
Rename Shader to SceneShader
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/sceneShader.cpp (renamed from gfx/gl/shader.cpp)12
-rw-r--r--gfx/gl/sceneShader.h (renamed from gfx/gl/shader.h)4
-rw-r--r--gfx/renderable.h4
3 files changed, 10 insertions, 10 deletions
diff --git a/gfx/gl/shader.cpp b/gfx/gl/sceneShader.cpp
index a196e07..48c0f42 100644
--- a/gfx/gl/shader.cpp
+++ b/gfx/gl/sceneShader.cpp
@@ -1,4 +1,4 @@
-#include "shader.h"
+#include "sceneShader.h"
#include "gfx/gl/glSource.h"
#include <array>
#include <cstddef>
@@ -15,7 +15,7 @@
#include <location.hpp>
#include <maths.h>
-Shader::ProgramHandle::ProgramHandle(GLuint vs, GLuint fs) : ProgramHandleBase {vs, fs}
+SceneShader::ProgramHandle::ProgramHandle(GLuint vs, GLuint fs) : ProgramHandleBase {vs, fs}
{
glBindAttribLocation(m_program, 0, "position");
glBindAttribLocation(m_program, 1, "texCoord");
@@ -25,7 +25,7 @@ Shader::ProgramHandle::ProgramHandle(GLuint vs, GLuint fs) : ProgramHandleBase {
model_uniform = glGetUniformLocation(m_program, "model");
}
-Shader::Shader() :
+SceneShader::SceneShader() :
programs {{{
basicShader_vs.compile(),
basicShader_fs.compile(),
@@ -46,7 +46,7 @@ Shader::Shader() :
}
void
-Shader::setView(glm::mat4 proj) const
+SceneShader::setView(glm::mat4 proj) const
{
for (const auto & prog : programs) {
glUseProgram(prog.m_program);
@@ -55,7 +55,7 @@ Shader::setView(glm::mat4 proj) const
}
void
-Shader::setUniform(const GLchar * uniform, glm::vec3 v) const
+SceneShader::setUniform(const GLchar * uniform, glm::vec3 v) const
{
for (const auto & prog : programs) {
if (auto loc = glGetUniformLocation(prog.m_program, uniform); loc >= 0) {
@@ -66,7 +66,7 @@ Shader::setUniform(const GLchar * uniform, glm::vec3 v) const
}
void
-Shader::setModel(const Location & loc, Program pid) const
+SceneShader::setModel(const Location & loc, Program pid) const
{
auto & prog = programs[static_cast<std::size_t>(pid)];
glUseProgram(prog.m_program);
diff --git a/gfx/gl/shader.h b/gfx/gl/sceneShader.h
index 8411b94..61c159b 100644
--- a/gfx/gl/shader.h
+++ b/gfx/gl/sceneShader.h
@@ -7,11 +7,11 @@
class Location;
-class Shader {
+class SceneShader {
public:
enum class Program { Basic = 0, Water = 1, LandMass = 2, StaticPos = 3 };
- Shader();
+ SceneShader();
void setView(glm::mat4 view) const;
void setModel(const Location &, Program = Program::Basic) const;
diff --git a/gfx/renderable.h b/gfx/renderable.h
index 565f705..9b25645 100644
--- a/gfx/renderable.h
+++ b/gfx/renderable.h
@@ -2,7 +2,7 @@
#include <special_members.hpp>
-class Shader;
+class SceneShader;
class Renderable {
public:
@@ -10,5 +10,5 @@ public:
virtual ~Renderable() = default;
DEFAULT_MOVE_COPY(Renderable);
- virtual void render(const Shader & shader) const = 0;
+ virtual void render(const SceneShader & shader) const = 0;
};