[cogl/wip/cogl-sharp: 43/51] cogl-sharp: Check for errors when creating a Context



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

    cogl-sharp: Check for errors 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]