summaryrefslogtreecommitdiff
path: root/gfx/gl/sceneShader.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-11-23 17:53:32 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-11-23 18:38:46 +0000
commit5b415937c6c7097373bfd754b5699a9946c2cd16 (patch)
tree8f9978bdd0670b3f70c2775ad91bfaff46f873bf /gfx/gl/sceneShader.h
parentRename setView to setViewProjection to avoid ambiguity (diff)
downloadilt-5b415937c6c7097373bfd754b5699a9946c2cd16.tar.bz2
ilt-5b415937c6c7097373bfd754b5699a9946c2cd16.tar.xz
ilt-5b415937c6c7097373bfd754b5699a9946c2cd16.zip
Support setting a viewPort uniform for those shaders which need it
Diffstat (limited to 'gfx/gl/sceneShader.h')
-rw-r--r--gfx/gl/sceneShader.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/gl/sceneShader.h b/gfx/gl/sceneShader.h
index 8094e0a..99431f1 100644
--- a/gfx/gl/sceneShader.h
+++ b/gfx/gl/sceneShader.h
@@ -8,14 +8,17 @@ class SceneShader {
class SceneProgram : public Program {
public:
template<typename... S>
- inline SceneProgram(const S &... srcs) : Program {srcs...}, viewProjectionLoc {*this, "viewProjection"}
+ inline SceneProgram(const S &... srcs) :
+ Program {srcs...}, viewProjectionLoc {*this, "viewProjection"}, viewPortLoc {*this, "viewPort"}
{
}
void setViewProjection(const glm::mat4 &) const;
+ void setViewPort(const glm::ivec4 &) const;
private:
RequiredUniformLocation viewProjectionLoc;
+ UniformLocation viewPortLoc;
};
class BasicProgram : public SceneProgram {
@@ -52,4 +55,5 @@ public:
AbsolutePosProgram landmass, absolute;
void setViewProjection(const glm::mat4 & viewProjection) const;
+ void setViewPort(const glm::ivec4 & viewPort) const;
};