From 0d0f57878879b70fde0cfaf7f308e3e1d8fcc45f Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Mon, 11 Nov 2013 11:42:30 +0100 Subject: [PATCH 1/3] Enabled SAMPLE_BUFFERS EGL attribute This attribute is required for multisampling support. --- Source/OpenTK/Platform/Egl/EglGraphicsMode.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/OpenTK/Platform/Egl/EglGraphicsMode.cs b/Source/OpenTK/Platform/Egl/EglGraphicsMode.cs index b6f0a35e..07f847e9 100644 --- a/Source/OpenTK/Platform/Egl/EglGraphicsMode.cs +++ b/Source/OpenTK/Platform/Egl/EglGraphicsMode.cs @@ -67,7 +67,7 @@ namespace OpenTK.Platform.Egl Egl.DEPTH_SIZE, depth > 0 ? depth : 0, Egl.STENCIL_SIZE, stencil > 0 ? stencil : 0, - //Egl.SAMPLE_BUFFERS, samples > 0 ? 1 : 0, + Egl.SAMPLE_BUFFERS, samples > 0 ? 1 : 0, Egl.SAMPLES, samples > 0 ? samples : 0, Egl.NONE, From 12005e0792149cd31b125d4198e3a8b0d42aa790 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Mon, 11 Nov 2013 11:43:15 +0100 Subject: [PATCH 2/3] Try to create Embedded context first By mistake, this code would always create a desktop context. The correct approach is to create an embedded (EGL) context and only fallback to desktop if that doesn't work. --- Source/Examples/OpenGLES/2.0/SimpleWindow20.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs b/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs index b810b24f..ac01e84a 100644 --- a/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs +++ b/Source/Examples/OpenGLES/2.0/SimpleWindow20.cs @@ -24,7 +24,7 @@ namespace Examples.Tutorial #region Constructor public SimpleES20Window(GraphicsContextFlags flags) - : base(800, 600, new GraphicsMode(16, 16), "", GameWindowFlags.Default, DisplayDevice.Default, 2, 0, flags) + : base(800, 600, GraphicsMode.Default, "", GameWindowFlags.Default, DisplayDevice.Default, 2, 0, flags) { } #endregion @@ -111,9 +111,7 @@ namespace Examples.Tutorial SimpleES20Window example; try { - example = new SimpleES20Window(GraphicsContextFlags.Default); - - //example = new SimpleES20Window(GraphicsContextFlags.Embedded); + example = new SimpleES20Window(GraphicsContextFlags.Embedded); } catch { From 873f8fb6ebd9aaf6e57cadb4053537f127cc02c7 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Mon, 11 Nov 2013 11:44:21 +0100 Subject: [PATCH 3/3] Cleaned up test code committed by mistake. --- Source/Examples/Main.cs | 2 -- Source/Examples/OpenTK/Test/GameWindowStates.cs | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Source/Examples/Main.cs b/Source/Examples/Main.cs index b9224cfd..5da07c59 100644 --- a/Source/Examples/Main.cs +++ b/Source/Examples/Main.cs @@ -85,8 +85,6 @@ namespace Examples public static void Main(string[] args) { Trace.Listeners.Add(new ConsoleTraceListener()); - LaunchExample(typeof(Examples.Tests.GameWindowStates).FullName); - return; if (args.Length > 0) { diff --git a/Source/Examples/OpenTK/Test/GameWindowStates.cs b/Source/Examples/OpenTK/Test/GameWindowStates.cs index eda29cce..6977de2a 100644 --- a/Source/Examples/OpenTK/Test/GameWindowStates.cs +++ b/Source/Examples/OpenTK/Test/GameWindowStates.cs @@ -29,8 +29,7 @@ namespace Examples.Tests KeyboardState keyboard, keyboard_old; public GameWindowStates() - : base(800, 600, GraphicsMode.Default, "Test", GameWindowFlags.Default, - DisplayDevice.GetDisplay(DisplayIndex.Second), 1, 0, GraphicsContextFlags.Embedded) + : base(800, 600, GraphicsMode.Default) { VSync = VSyncMode.On; Keyboard.KeyRepeat = true;