Ver código fonte

Enabled MSAA for splitview example.

Camilla Berglund 10 anos atrás
pai
commit
24e4e674a5
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      examples/splitview.c

+ 10 - 0
examples/splitview.c

@@ -11,6 +11,7 @@
 //========================================================================
 
 #define GLFW_INCLUDE_GLU
+#define GLFW_INCLUDE_GLEXT
 #include <GLFW/glfw3.h>
 
 #include <math.h>
@@ -469,6 +470,8 @@ int main(void)
         exit(EXIT_FAILURE);
     }
 
+    glfwWindowHint(GLFW_SAMPLES, 4);
+
     // Open OpenGL window
     window = glfwCreateWindow(500, 500, "Split view demo", NULL, NULL);
     if (!window)
@@ -490,6 +493,13 @@ int main(void)
     glfwMakeContextCurrent(window);
     glfwSwapInterval(1);
 
+    if (glfwExtensionSupported("GL_ARB_multisample") ||
+        glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MAJOR) >= 2 ||
+        glfwGetWindowAttrib(window, GLFW_CONTEXT_VERSION_MINOR) >= 3)
+    {
+        glEnable(GL_MULTISAMPLE_ARB);
+    }
+
     glfwGetFramebufferSize(window, &width, &height);
     framebufferSizeFun(window, width, height);