* EglWindowInfo.cs: Corrected error checking for

CreateWindowSurface. Fixes issue [#2248]: "EGL CreateWindowSurface
  function is incorrect".
This commit is contained in:
the_fiddler 2011-01-17 23:55:48 +00:00
parent a964d3a9de
commit d22c7312d9

View file

@ -73,9 +73,11 @@ namespace OpenTK.Platform.Egl
public void CreateWindowSurface(IntPtr config) public void CreateWindowSurface(IntPtr config)
{ {
Surface = Egl.CreateWindowSurface(Display, config, Handle, null); Surface = Egl.CreateWindowSurface(Display, config, Handle, null);
int error = Egl.GetError(); if (Surface==IntPtr.Zero)
if (error != Egl.SUCCESS) {
throw new GraphicsContextException(String.Format("[Error] Failed to create EGL window surface, error {0}.", error)); throw new GraphicsContextException(String.Format(
"[Error] Failed to create EGL window surface, error {0}.", Egl.GetError()));
}
} }
//public void CreatePixmapSurface(EGLConfig config) //public void CreatePixmapSurface(EGLConfig config)