Browse Source

Fix compile for OpenGL ES 2.0.

Lasse Öörni 9 years ago
parent
commit
3cb270060f
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Source/Urho3D/Graphics/OpenGL/OGLTexture2DArray.cpp

+ 6 - 2
Source/Urho3D/Graphics/OpenGL/OGLTexture2DArray.cpp

@@ -567,6 +567,11 @@ bool Texture2DArray::Create()
 {
 {
     Release();
     Release();
 
 
+#ifdef GL_ES_VERSION_2_0
+    URHO3D_LOGERROR("Failed to create 2D array texture, currently unsupported on OpenGL ES 2");
+    return false;
+#else
+
     if (!graphics_ || !width_ || !height_ || !layers_)
     if (!graphics_ || !width_ || !height_ || !layers_)
         return false;
         return false;
 
 
@@ -609,16 +614,15 @@ bool Texture2DArray::Create()
         }
         }
     }
     }
 
 
-#ifndef GL_ES_VERSION_2_0
     glTexParameteri(target_, GL_TEXTURE_BASE_LEVEL, 0);
     glTexParameteri(target_, GL_TEXTURE_BASE_LEVEL, 0);
     glTexParameteri(target_, GL_TEXTURE_MAX_LEVEL, levels_ - 1);
     glTexParameteri(target_, GL_TEXTURE_MAX_LEVEL, levels_ - 1);
-#endif
 
 
     // Set initial parameters, then unbind the texture
     // Set initial parameters, then unbind the texture
     UpdateParameters();
     UpdateParameters();
     graphics_->SetTexture(0, 0);
     graphics_->SetTexture(0, 0);
 
 
     return success;
     return success;
+#endif
 }
 }
 
 
 void Texture2DArray::HandleRenderSurfaceUpdate(StringHash eventType, VariantMap& eventData)
 void Texture2DArray::HandleRenderSurfaceUpdate(StringHash eventType, VariantMap& eventData)