gamnit: request 4x antialiasing
authorAlexis Laferrière <alexis.laf@xymus.net>
Wed, 8 Nov 2017 16:59:43 +0000 (11:59 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 17 Jan 2018 17:44:34 +0000 (12:44 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

lib/gamnit/display_android.nit
lib/gamnit/display_linux.nit
lib/gamnit/egl.nit

index 14a3762..d198790 100644 (file)
@@ -39,7 +39,7 @@ redef class GamnitDisplay
                setup_egl_display native_display
 
                # We need 8 bits per color for selection by color
-               select_egl_config(red_bits, green_bits, blue_bits, 0, 8, 0, 0)
+               select_egl_config(red_bits, green_bits, blue_bits, 0, 8, 0)
 
                var format = egl_config.attribs(egl_display).native_visual_id
                assert not native_window.address_is_null
index e9af008..f678bbe 100644 (file)
@@ -50,7 +50,7 @@ redef class GamnitDisplay
                setup_egl_display sdl_window.wm_info.display_handle
 
                if debug_gamnit then print "Setting up EGL context"
-               select_egl_config(red_bits, green_bits, blue_bits, 8, 8, 0, 0)
+               select_egl_config(red_bits, green_bits, blue_bits, 8, 8, 0)
                setup_egl_context sdl_window.wm_info.window_handle
        end
 
index f8c7a1c..f425b58 100644 (file)
@@ -46,7 +46,7 @@ redef class GamnitDisplay
        end
 
        # Select an EGL config
-       protected fun select_egl_config(red, green, blue, alpha, depth, stencil, sample: Int)
+       protected fun select_egl_config(red, green, blue, alpha, depth, stencil: Int)
        do
                var config_chooser = new EGLConfigChooser
                config_chooser.renderable_type_egl
@@ -57,7 +57,10 @@ redef class GamnitDisplay
                if alpha > 0 then config_chooser.alpha_size = alpha
                if depth > 0 then config_chooser.depth_size = depth
                if stencil > 0 then config_chooser.stencil_size = stencil
-               if sample > 0 then config_chooser.sample_buffers = sample
+
+               config_chooser.sample_buffers = 1
+               config_chooser.samples = 4
+
                config_chooser.close
 
                var configs = config_chooser.choose(egl_display)
@@ -72,6 +75,7 @@ redef class GamnitDisplay
                                print "  Caveats: {attribs.caveat}"
                                print "  Size of RGBA: {attribs.red_size} {attribs.green_size} {attribs.blue_size} {attribs.alpha_size}"
                                print "  Buffer, depth, stencil: {attribs.buffer_size} {attribs.depth_size} {attribs.stencil_size}"
+                               print "  Sample buffers, samples: {attribs.sample_buffers} {attribs.samples}"
                        end
                end