Ver código fonte

Add OpenGL fallback for album texture reads (#674)

JMarsz-EA 1 mês atrás
pai
commit
84e3b26b11
1 arquivos alterados com 7 adições e 2 exclusões
  1. 7 2
      src/WallpaperEngine/Render/AlbumTexture.cpp

+ 7 - 2
src/WallpaperEngine/Render/AlbumTexture.cpp

@@ -75,7 +75,12 @@ void AlbumTexture::copyContents (const TextureProvider& other) const noexcept {
 
     // Read the source texture
     glBindTexture (GL_TEXTURE_2D, other.getTextureID (0));
-    glGetnTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, bufferSize, buffer);
+
+    if (GLEW_VERSION_4_5) {
+        glGetnTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, bufferSize, buffer);
+    } else {
+        glGetTexImage (GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
+    }
 
     // Upload into another texture
     glBindTexture (GL_TEXTURE_2D, this->m_textureID);
@@ -133,4 +138,4 @@ void AlbumTexture::load () const {
 bool AlbumTexture::isReady () const {
     // these are only ready to be rendered if their content's are present
     return this->m_width > 0 && this->m_height > 0;
-}
+}