Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/OpenGL/OpenGLTexture.cpp @ 2046:98b44468332e deep-learning
note
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 06 Mar 2023 09:04:10 +0100 |
parents | e5c812a36746 |
children | 0b596428e60c |
comparison
equal
deleted
inserted
replaced
2045:e5c812a36746 | 2046:98b44468332e |
---|---|
112 GLint interpolation = (isLinearInterpolation ? GL_LINEAR : GL_NEAREST); | 112 GLint interpolation = (isLinearInterpolation ? GL_LINEAR : GL_NEAREST); |
113 | 113 |
114 // Load the texture from the image buffer | 114 // Load the texture from the image buffer |
115 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, | 115 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, |
116 0, sourceFormat, pixelType, data); | 116 0, sourceFormat, pixelType, data); |
117 ORTHANC_OPENGL_CHECK("glTexImage2D()"); | |
117 | 118 |
118 #if !defined(__EMSCRIPTEN__) | 119 #if !defined(__EMSCRIPTEN__) |
119 // glGetTexLevelParameteriv() is not implemented yet in Emscripten 3.1.7 | 120 /** |
121 * glGetTexLevelParameteriv() was introduced in OpenGL ES 3.1, | |
122 * but WebGL 2 only supports OpenGL ES 3.0, so it is not | |
123 * available in WebAssembly: | |
124 * https://registry.khronos.org/OpenGL-Refpages/es3.1/html/glGetTexLevelParameter.xhtml | |
125 **/ | |
120 GLint w, h; | 126 GLint w, h; |
121 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); | 127 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); |
122 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h); | 128 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h); |
123 if (width != static_cast<unsigned int>(w) || | 129 if (width != static_cast<unsigned int>(w) || |
124 height != static_cast<unsigned int>(h)) | 130 height != static_cast<unsigned int>(h)) |