diff --git a/src/canvas.cpp b/src/canvas.cpp index e13e095..097f7cf 100644 --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -1254,7 +1254,7 @@ void Canvas::export_equirectangular_thread(std::string file_path) glBindTexture(GL_TEXTURE_CUBE_MAP, cube_id); for (GLuint i = 0; i < 6; i++) glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGBA8, m_width, m_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr); - int faces[]{ + static int faces[]{ GL_TEXTURE_CUBE_MAP_NEGATIVE_Z, // front GL_TEXTURE_CUBE_MAP_NEGATIVE_X, // right GL_TEXTURE_CUBE_MAP_POSITIVE_Z, // back @@ -1268,6 +1268,10 @@ void Canvas::export_equirectangular_thread(std::string file_path) for (int i = 0; i < 6; i++) { + // prepare common states + glViewport(0, 0, m_width, m_height); + glEnable(GL_BLEND); + ShaderManager::use(kShader::TextureAlpha); ShaderManager::u_int(kShaderUniform::Highlight, false); ShaderManager::u_int(kShaderUniform::Tex, 0);