Skip to content

Commit

Permalink
glGetTexImage method is not available in webgl
Browse files Browse the repository at this point in the history
  • Loading branch information
bchapuis committed Nov 13, 2024
1 parent 59362f2 commit d0639fc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/threepp/renderers/GLRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,10 @@ struct GLRenderer::Impl {
const auto newSize = image.width * image.height * (texture.format == Format::RGB || texture.format == Format::BGR ? 3 : 4);
data.resize(newSize);

#ifndef __EMSCRIPTEN__
// Only run this on desktop OpenGL, not in WebGL
glGetTexImage(GL_TEXTURE_2D, 0, gl::toGLFormat(texture.format), gl::toGLType(texture.type), data.data());
#endif

state.unbindTexture();
}
Expand Down

0 comments on commit d0639fc

Please sign in to comment.