Selaa lähdekoodia

Implement Graphics::GetMultiSampleLevels() on OpenGL by querying GL_MAX_SAMPLES. Closes #1774.

Lasse Öörni 9 vuotta sitten
vanhempi
sitoutus
dd32227ed7
1 muutettua tiedostoa jossa 7 lisäystä ja 1 poistoa
  1. 7 1
      Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

+ 7 - 1
Source/Urho3D/Graphics/OpenGL/OGLGraphics.cpp

@@ -2082,8 +2082,14 @@ PODVector<int> Graphics::GetMultiSampleLevels() const
     PODVector<int> ret;
     // No multisampling always supported
     ret.Push(1);
-    /// \todo Implement properly, if possible
 
+#ifndef GL_ES
+    int maxSamples = 0;
+    glGetIntegerv(GL_MAX_SAMPLES, &maxSamples);
+    for (int i = 2; i <= maxSamples && i <= 16; i *= 2)
+        ret.Push(i);
+#endif
+    
     return ret;
 }