comparison OrthancStone/Sources/Scene2D/Internals/OpenGLColorTextureProgram.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 244ad1e4e76a
children 4fb8fdf03314
comparison
equal deleted inserted replaced
1575:e4a52cbbdd70 1576:92fca2b3ba3d
43 } 43 }
44 44
45 45
46 void OpenGLColorTextureProgram::Apply(OpenGL::OpenGLTexture& texture, 46 void OpenGLColorTextureProgram::Apply(OpenGL::OpenGLTexture& texture,
47 const AffineTransform2D& transform, 47 const AffineTransform2D& transform,
48 unsigned int canvasWidth,
49 unsigned int canvasHeight,
48 bool useAlpha) 50 bool useAlpha)
49 { 51 {
50 if (!context_.IsContextLost()) 52 if (!context_.IsContextLost())
51 { 53 {
52 OpenGLTextureProgram::Execution execution(program_, texture, transform); 54 OpenGLTextureProgram::Execution execution(program_, texture, transform, canvasWidth, canvasHeight);
53 55
54 if (useAlpha) 56 if (useAlpha)
55 { 57 {
56 glEnable(GL_BLEND); 58 glEnable(GL_BLEND);
57 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 59 glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);