comparison OrthancStone/Sources/OpenGL/OpenGLTexture.cpp @ 2056:66c130af0d3c deep-learning

OpenGLTexture::SetClampingToZero() is not available in wasm
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 18 Apr 2023 15:18:36 +0200
parents a05b03f45289
children c0627145b441
comparison
equal deleted inserted replaced
2055:d4e769a0961f 2056:66c130af0d3c
271 } 271 }
272 272
273 273
274 void OpenGLTexture::SetClampingToZero() 274 void OpenGLTexture::SetClampingToZero()
275 { 275 {
276 ORTHANC_OPENGL_CHECK("Entering OpenGLTexture::SetClampingToZero()");
277
278 #if defined(__EMSCRIPTEN__)
279 /**
280 * This is because WebGL 2 derives from OpenGL ES 3.0, which
281 * doesn't support GL_CLAMP_TO_BORDER, as can be seen here:
282 * https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glTexParameter.xhtml
283 **/
284 LOG(WARNING) << "OpenGLTexture::SetClampingToZero() is not available in WebGL 2";
285 #else
276 glBindTexture(GL_TEXTURE_2D, texture_); 286 glBindTexture(GL_TEXTURE_2D, texture_);
277 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER); 287 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
278 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER); 288 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
279 289
280 GLfloat colorfv[4] = { 0, 0, 0, 0 }; 290 GLfloat colorfv[4] = { 0, 0, 0, 0 };
281 glTextureParameterfv(texture_, GL_TEXTURE_BORDER_COLOR, colorfv); 291 glTextureParameterfv(texture_, GL_TEXTURE_BORDER_COLOR, colorfv);
292 #endif
293
294 ORTHANC_OPENGL_CHECK("Exiting OpenGLTexture::SetClampingToZero()");
282 } 295 }
283 296
284 297
285 void OpenGLTexture::ConvertToOpenGLFormats(GLenum& sourceFormat, 298 void OpenGLTexture::ConvertToOpenGLFormats(GLenum& sourceFormat,
286 GLenum& internalFormat, 299 GLenum& internalFormat,