comparison Framework/Scene2D/Internals/OpenGLTextProgram.cpp @ 698:8b6adfb62a2f refactor-viewport-controller

Code is broken -- stashing ongoing work in a branch
author Benjamin Golinvaux <bgo@osimis.io>
date Wed, 15 May 2019 16:56:17 +0200
parents e3f21a265be5
children 5c551f078c18
comparison
equal deleted inserted replaced
660:cb3b76d16234 698:8b6adfb62a2f
153 { 153 {
154 context_.MakeCurrent(); 154 context_.MakeCurrent();
155 program_->Use(); 155 program_->Use();
156 156
157 double dx, dy; // In pixels 157 double dx, dy; // In pixels
158 ComputeAnchorTranslation(dx, dy, data.GetAnchor(), 158 ComputeAnchorTranslation(dx, dy, data.GetAnchor(), data.GetTextWidth(),
159 data.GetTextWidth(), data.GetTextHeight(), data.GetBorder()); 159 data.GetTextHeight(), static_cast<unsigned int>(data.GetBorder()));
160 160
161 double x = data.GetX(); 161 double x = data.GetX();
162 double y = data.GetY(); 162 double y = data.GetY();
163 transform.Apply(x, y); 163 transform.Apply(x, y);
164 164
180 glEnableVertexAttribArray(textureLocation_); 180 glEnableVertexAttribArray(textureLocation_);
181 glVertexAttribPointer(textureLocation_, COMPONENTS, GL_FLOAT, GL_FALSE, 0, 0); 181 glVertexAttribPointer(textureLocation_, COMPONENTS, GL_FLOAT, GL_FALSE, 0, 0);
182 182
183 glEnable(GL_BLEND); 183 glEnable(GL_BLEND);
184 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 184 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
185 glDrawArrays(GL_TRIANGLES, 0, data.GetCoordinatesCount() / COMPONENTS); 185 glDrawArrays(GL_TRIANGLES, 0,
186 static_cast<GLsizei>(data.GetCoordinatesCount() / COMPONENTS));
186 glDisable(GL_BLEND); 187 glDisable(GL_BLEND);
187 188
188 glDisableVertexAttribArray(positionLocation_); 189 glDisableVertexAttribArray(positionLocation_);
189 glDisableVertexAttribArray(textureLocation_); 190 glDisableVertexAttribArray(textureLocation_);
190 } 191 }