Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/Scene2D/Internals/OpenGLTextureProgram.h @ 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 |
---|---|
40 GLint positionLocation_; | 40 GLint positionLocation_; |
41 GLint textureLocation_; | 41 GLint textureLocation_; |
42 GLuint buffers_[2]; | 42 GLuint buffers_[2]; |
43 | 43 |
44 void InitializeExecution(OpenGL::OpenGLTexture& texture, | 44 void InitializeExecution(OpenGL::OpenGLTexture& texture, |
45 const AffineTransform2D& transform); | 45 const AffineTransform2D& transform, |
46 unsigned int canvasWidth, | |
47 unsigned int canvasHeight); | |
46 | 48 |
47 void FinalizeExecution(); | 49 void FinalizeExecution(); |
48 | 50 |
49 public: | 51 public: |
50 OpenGLTextureProgram(OpenGL::IOpenGLContext& context, | 52 OpenGLTextureProgram(OpenGL::IOpenGLContext& context, |
58 OpenGLTextureProgram& that_; | 60 OpenGLTextureProgram& that_; |
59 | 61 |
60 public: | 62 public: |
61 Execution(OpenGLTextureProgram& that, | 63 Execution(OpenGLTextureProgram& that, |
62 OpenGL::OpenGLTexture& texture, | 64 OpenGL::OpenGLTexture& texture, |
63 const AffineTransform2D& transform) : | 65 const AffineTransform2D& transform, |
66 unsigned int canvasWidth, | |
67 unsigned int canvasHeight) : | |
64 that_(that) | 68 that_(that) |
65 { | 69 { |
66 that_.InitializeExecution(texture, transform); | 70 that_.InitializeExecution(texture, transform, canvasWidth, canvasHeight); |
67 } | 71 } |
68 | 72 |
69 ~Execution() | 73 ~Execution() |
70 { | 74 { |
71 that_.FinalizeExecution(); | 75 that_.FinalizeExecution(); |