comparison OrthancStone/Sources/Scene2D/Internals/OpenGLFloatTextureProgram.cpp @ 1576:92fca2b3ba3d

sanitizing the handling of canvas size
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 24 Sep 2020 16:40:30 +0200
parents 85e117739eca
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1575:e4a52cbbdd70 1576:92fca2b3ba3d
139 } 139 }
140 140
141 141
142 void OpenGLFloatTextureProgram::Apply(Data& data, 142 void OpenGLFloatTextureProgram::Apply(Data& data,
143 const AffineTransform2D& transform, 143 const AffineTransform2D& transform,
144 unsigned int canvasWidth,
145 unsigned int canvasHeight,
144 float windowCenter, 146 float windowCenter,
145 float windowWidth, 147 float windowWidth,
146 bool invert) 148 bool invert)
147 { 149 {
148 if (!context_.IsContextLost()) 150 if (!context_.IsContextLost())
149 { 151 {
150 OpenGLTextureProgram::Execution execution(program_, data.GetTexture(), transform); 152 OpenGLTextureProgram::Execution execution(
153 program_, data.GetTexture(), transform, canvasWidth, canvasHeight);
151 154
152 glUniform1f(execution.GetUniformLocation("u_slope"), data.GetSlope()); 155 glUniform1f(execution.GetUniformLocation("u_slope"), data.GetSlope());
153 glUniform1f(execution.GetUniformLocation("u_offset"), data.GetOffset()); 156 glUniform1f(execution.GetUniformLocation("u_offset"), data.GetOffset());
154 glUniform1f(execution.GetUniformLocation("u_windowCenter"), windowCenter); 157 glUniform1f(execution.GetUniformLocation("u_windowCenter"), windowCenter);
155 glUniform1f(execution.GetUniformLocation("u_windowWidth"), windowWidth); 158 glUniform1f(execution.GetUniformLocation("u_windowWidth"), windowWidth);