From d22c7312d9fc8aa261d5a6b2906ae79d4f5b967c Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Mon, 17 Jan 2011 23:55:48 +0000 Subject: [PATCH] * EglWindowInfo.cs: Corrected error checking for CreateWindowSurface. Fixes issue [#2248]: "EGL CreateWindowSurface function is incorrect". --- Source/OpenTK/Platform/Egl/EglWindowInfo.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/Platform/Egl/EglWindowInfo.cs b/Source/OpenTK/Platform/Egl/EglWindowInfo.cs index eb6eab5d..a19821bd 100644 --- a/Source/OpenTK/Platform/Egl/EglWindowInfo.cs +++ b/Source/OpenTK/Platform/Egl/EglWindowInfo.cs @@ -73,9 +73,11 @@ namespace OpenTK.Platform.Egl public void CreateWindowSurface(IntPtr config) { Surface = Egl.CreateWindowSurface(Display, config, Handle, null); - int error = Egl.GetError(); - if (error != Egl.SUCCESS) - throw new GraphicsContextException(String.Format("[Error] Failed to create EGL window surface, error {0}.", error)); + if (Surface==IntPtr.Zero) + { + throw new GraphicsContextException(String.Format( + "[Error] Failed to create EGL window surface, error {0}.", Egl.GetError())); + } } //public void CreatePixmapSurface(EGLConfig config)