comparison OrthancStone/Sources/OpenGL/OpenGLTexture.cpp @ 2039:e0906b7c67b9 deep-learning

const
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 28 Jan 2023 15:48:01 +0100
parents d81a7157a846
children 0fa4c0ca429d
comparison
equal deleted inserted replaced
2038:a72ca4959aa6 2039:e0906b7c67b9
146 isLinearInterpolation, image.GetConstBuffer()); 146 isLinearInterpolation, image.GetConstBuffer());
147 } 147 }
148 } 148 }
149 149
150 150
151 void OpenGLTexture::Bind(GLint location) 151 void OpenGLTexture::Bind(GLint location) const
152 { 152 {
153 glActiveTexture(GL_TEXTURE0); 153 glActiveTexture(GL_TEXTURE0);
154 glBindTexture(GL_TEXTURE_2D, texture_); 154 glBindTexture(GL_TEXTURE_2D, texture_);
155 glUniform1i(location, 0 /* texture unit */); 155 glUniform1i(location, 0 /* texture unit */);
156 } 156 }
157 157
158 158
159 Orthanc::ImageAccessor* OpenGLTexture::Download(Orthanc::PixelFormat format) 159 Orthanc::ImageAccessor* OpenGLTexture::Download(Orthanc::PixelFormat format) const
160 { 160 {
161 if (context_.IsContextLost()) 161 if (context_.IsContextLost())
162 { 162 {
163 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, 163 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError,
164 "OpenGL context is lost"); 164 "OpenGL context is lost");