Mercurial > hg > orthanc-stone
comparison OrthancStone/Sources/OpenGL/OpenGLTexture.cpp @ 2043:f3d756e5503f deep-learning
fix build on wasm
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 10 Feb 2023 09:13:49 +0100 |
parents | 0fa4c0ca429d |
children | c9dadbe7c7b0 |
comparison
equal
deleted
inserted
replaced
2042:0fa4c0ca429d | 2043:f3d756e5503f |
---|---|
111 | 111 |
112 // Load the texture from the image buffer | 112 // Load the texture from the image buffer |
113 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, | 113 glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, width, height, |
114 0, sourceFormat, pixelType, data); | 114 0, sourceFormat, pixelType, data); |
115 | 115 |
116 #if !defined(__EMSCRIPTEN__) | |
117 // "glGetTexLevelParameteriv()" seems to be undefined on WebGL | |
116 GLint w, h; | 118 GLint w, h; |
117 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); | 119 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); |
118 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h); | 120 glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &h); |
119 if (width != static_cast<unsigned int>(w) || | 121 if (width != static_cast<unsigned int>(w) || |
120 height != static_cast<unsigned int>(h)) | 122 height != static_cast<unsigned int>(h)) |
122 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, | 124 throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError, |
123 "Your GPU cannot create a texture of size " + | 125 "Your GPU cannot create a texture of size " + |
124 boost::lexical_cast<std::string>(width) + " x " + | 126 boost::lexical_cast<std::string>(width) + " x " + |
125 boost::lexical_cast<std::string>(height)); | 127 boost::lexical_cast<std::string>(height)); |
126 } | 128 } |
129 #endif | |
127 | 130 |
128 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, interpolation); | 131 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, interpolation); |
129 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, interpolation); | 132 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, interpolation); |
130 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); | 133 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
131 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); | 134 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); |