瀏覽代碼

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

Lasse Öörni 9 年之前
父節點
當前提交
dd32227ed7
共有 1 個文件被更改,包括 7 次插入1 次删除
  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;
     PODVector<int> ret;
     // No multisampling always supported
     // No multisampling always supported
     ret.Push(1);
     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;
     return ret;
 }
 }