From 62c9793a6e6417013fdff9df9b28a65da964bf1a Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Wed, 6 Nov 2013 01:04:59 +0100 Subject: [PATCH] Fixed number of buffers ContextAttribute.DOUBLEBUFFER is a boolean in SDL (false->single buffering, true->double buffering). We need to adjust the number of buffers accordingly (single buffering->1 buffer, double buffering->2 buffers). --- Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs index 633a2450..e7ea0a09 100644 --- a/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs +++ b/Source/OpenTK/Platform/SDL2/Sdl2GraphicsContext.cs @@ -92,6 +92,9 @@ namespace OpenTK.Platform.SDL2 int buffers; SDL.GL.GetAttribute(ContextAttribute.DOUBLEBUFFER, out buffers); + // DOUBLEBUFFER return a boolean (0-false, 1-true), so we need + // to adjust the buffer count (false->1 buffer, true->2 buffers) + buffers++; int red, green, blue, alpha; SDL.GL.GetAttribute(ContextAttribute.RED_SIZE, out red);