[cogl/wip/cogl-sharp] cogl-sharp: Check for error when creating a Context



commit 1e4c357683e2a49b87ef37f0041cda1b928a1487
Author: Damien Lespiau <damien lespiau intel com>
Date:   Sun Nov 4 01:19:58 2012 +0000

    cogl-sharp: Check for error when creating a Context

 cogl-sharp/Context.cs |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/cogl-sharp/Context.cs b/cogl-sharp/Context.cs
index e4cec39..22c3052 100644
--- a/cogl-sharp/Context.cs
+++ b/cogl-sharp/Context.cs
@@ -35,11 +35,15 @@ namespace Cogl
 
         [DllImport("cogl2.dll")]
         private static extern IntPtr cogl_context_new(IntPtr display,
-                                                      IntPtr error);
+                                                      out IntPtr error);
 
         public Context()
         {
-            handle = cogl_context_new(IntPtr.Zero, IntPtr.Zero);
+            IntPtr error;
+
+            handle = cogl_context_new(IntPtr.Zero, out error);
+            if (error != IntPtr.Zero)
+                throw new Cogl.Exception(error);
         }
     }
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]