comparison OrthancStone/Sources/OpenGL/OpenGLFramebuffer.cpp @ 2064:4e31d76c7ecd deep-learning

making ImageProcessingProgram compatible with 3D volumes
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 04 May 2023 11:06:19 +0200
parents 86e0e92a2e0d
children cf3d85eb291c
comparison
equal deleted inserted replaced
2063:b6b5e1ca1cc2 2064:4e31d76c7ecd
189 189
190 190
191 void OpenGLFramebuffer::SetTarget(OpenGLTexture& target) 191 void OpenGLFramebuffer::SetTarget(OpenGLTexture& target)
192 { 192 {
193 glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, target.GetId(), 0); 193 glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, target.GetId(), 0);
194 ORTHANC_OPENGL_CHECK("glFramebufferTexture2D()");
195
194 SetupTextureTarget(); 196 SetupTextureTarget();
195 glViewport(0, 0, target.GetWidth(), target.GetHeight()); 197 glViewport(0, 0, target.GetWidth(), target.GetHeight());
196 } 198 }
197 199
198 200
204 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 206 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
205 } 207 }
206 else 208 else
207 { 209 {
208 glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target.GetId(), 0, layer); 210 glFramebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target.GetId(), 0, layer);
211 ORTHANC_OPENGL_CHECK("glFramebufferTextureLayer()");
212
209 SetupTextureTarget(); 213 SetupTextureTarget();
210 glViewport(0, 0, target.GetWidth(), target.GetHeight()); 214 glViewport(0, 0, target.GetWidth(), target.GetHeight());
211 } 215 }
212 } 216 }
213 217