Browse Source

Added multisampling support on Linux

Marcin Jakubowski 13 years ago
parent
commit
b5b4f6ebf2
1 changed files with 5 additions and 1 deletions
  1. 5 1
      gameplay/src/PlatformLinux.cpp

+ 5 - 1
gameplay/src/PlatformLinux.cpp

@@ -513,7 +513,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
      
      
     // Get the window configuration values
     // Get the window configuration values
     const char *title = NULL;
     const char *title = NULL;
-    int __x = 0, __y = 0, __width = 1280, __height = 800;
+    int __x = 0, __y = 0, __width = 1280, __height = 800, __samples = 0;
     bool fullscreen = false;
     bool fullscreen = false;
     if (game->getConfig())
     if (game->getConfig())
     {
     {
@@ -528,6 +528,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
             int y = config->getInt("y");
             int y = config->getInt("y");
             int width = config->getInt("width");
             int width = config->getInt("width");
             int height = config->getInt("height");
             int height = config->getInt("height");
+            int samples = config->getInt("samples");
             fullscreen = config->getBool("fullscreen");
             fullscreen = config->getBool("fullscreen");
 
 
             if (fullscreen && width == 0 && height == 0)
             if (fullscreen && width == 0 && height == 0)
@@ -541,6 +542,7 @@ Platform* Platform::create(Game* game, void* attachToWindow)
             if (y != 0) __y = y;
             if (y != 0) __y = y;
             if (width != 0) __width = width;
             if (width != 0) __width = width;
             if (height != 0) __height = height;
             if (height != 0) __height = height;
+            if (samples != 0) __samples = samples;
         }
         }
     }
     }
 
 
@@ -578,6 +580,8 @@ Platform* Platform::create(Game* game, void* attachToWindow)
         GLX_GREEN_SIZE,     8,
         GLX_GREEN_SIZE,     8,
         GLX_BLUE_SIZE,      8,
         GLX_BLUE_SIZE,      8,
         GLX_DOUBLEBUFFER,   True,
         GLX_DOUBLEBUFFER,   True,
+        GLX_SAMPLE_BUFFERS, __samples > 0 ? 1 : 0,
+        GLX_SAMPLES,        __samples,
         0
         0
     };
     };
     GLXFBConfig* configs;
     GLXFBConfig* configs;