summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Lespiau <damien.lespiau@intel.com>2012-11-04 00:41:12 +0000
committerDamien Lespiau <damien.lespiau@intel.com>2013-01-04 20:29:36 +0000
commit57f1ff6432e86cccecfa3fe38f09c8c114d4542f (patch)
tree651801b182ff03e25cb9124558b71a803424d928
parent402b79e3b5640415366893a634d0404c28a1ffc8 (diff)
downloadcogl-57f1ff6432e86cccecfa3fe38f09c8c114d4542f.tar.gz
cogl-sharp: Expose Renderer
-rw-r--r--cogl-sharp/Makefile.am2
-rw-r--r--cogl-sharp/Renderer.cs73
-rw-r--r--cogl-sharp/_Renderer.cs66
-rwxr-xr-xcogl-sharp/parse-gir.py8
4 files changed, 148 insertions, 1 deletions
diff --git a/cogl-sharp/Makefile.am b/cogl-sharp/Makefile.am
index 499a2299..16c340d8 100644
--- a/cogl-sharp/Makefile.am
+++ b/cogl-sharp/Makefile.am
@@ -32,6 +32,8 @@ sources = \
PipelineWrapMode.cs \
PixelFormat.cs \
Quaternion.cs \
+ Renderer.cs \
+ _Renderer.cs \
RendererConstraint.cs \
SwapChain.cs \
_SwapChain.cs \
diff --git a/cogl-sharp/Renderer.cs b/cogl-sharp/Renderer.cs
new file mode 100644
index 00000000..e01fba62
--- /dev/null
+++ b/cogl-sharp/Renderer.cs
@@ -0,0 +1,73 @@
+/*
+ * Cogl
+ *
+ * An object oriented GL/GLES Abstraction/Utility Layer
+ *
+ * Copyright (C) 2012 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * Authors:
+ * Damien Lespiau <damien.lespiau@intel.com>
+ */
+using System;
+using System.Runtime.InteropServices;
+
+namespace Cogl
+{
+ public partial class Renderer : Cogl.Object
+ {
+ public Renderer(IntPtr h) : base(h) {}
+
+ [DllImport("cogl2.dll")]
+ private static extern IntPtr cogl_renderer_new();
+
+ public Renderer()
+ {
+ handle = cogl_renderer_new();
+ }
+
+ [DllImport("cogl2.dll")]
+ private static extern bool
+ cogl_renderer_check_onscreen_template(IntPtr renderer,
+ IntPtr template,
+ out IntPtr error);
+
+ public void CheckOnScreenTemplate(OnScreenTemplate template)
+ {
+ IntPtr error;
+
+ cogl_renderer_check_onscreen_template(handle,
+ template.Handle,
+ out error);
+ if (error != IntPtr.Zero)
+ throw new Cogl.Exception(error);
+ }
+
+ [DllImport("cogl2.dll")]
+ private static extern bool cogl_renderer_connect(IntPtr renderer,
+ out IntPtr error);
+
+ public void Connect()
+ {
+ IntPtr error;
+
+ cogl_renderer_connect(handle, out error);
+ if (error != IntPtr.Zero)
+ throw new Cogl.Exception(error);
+ }
+
+ }
+}
diff --git a/cogl-sharp/_Renderer.cs b/cogl-sharp/_Renderer.cs
new file mode 100644
index 00000000..8fb13507
--- /dev/null
+++ b/cogl-sharp/_Renderer.cs
@@ -0,0 +1,66 @@
+/* This file has been generated by parse-gir.py, do not hand edit */
+using System;
+using System.Runtime.InteropServices;
+
+namespace Cogl
+{
+ public partial class Renderer
+ {
+ [DllImport("cogl2.dll")]
+ public static extern void cogl_renderer_add_constraint(IntPtr o, RendererConstraint constraint);
+
+ public void AddConstraint(RendererConstraint constraint)
+ {
+ cogl_renderer_add_constraint(handle, constraint);
+ }
+
+ [DllImport("cogl2.dll")]
+ public static extern Driver cogl_renderer_get_driver(IntPtr o);
+
+ public Driver GetDriver()
+ {
+ return cogl_renderer_get_driver(handle);
+ }
+
+ [DllImport("cogl2.dll")]
+ public static extern int cogl_renderer_get_n_fragment_texture_units(IntPtr o);
+
+ public int GetNFragmentTextureUnits()
+ {
+ return cogl_renderer_get_n_fragment_texture_units(handle);
+ }
+
+ [DllImport("cogl2.dll")]
+ public static extern WinsysID cogl_renderer_get_winsys_id(IntPtr o);
+
+ public WinsysID GetWinsysId()
+ {
+ return cogl_renderer_get_winsys_id(handle);
+ }
+
+ [DllImport("cogl2.dll")]
+ public static extern void cogl_renderer_remove_constraint(IntPtr o, RendererConstraint constraint);
+
+ public void RemoveConstraint(RendererConstraint constraint)
+ {
+ cogl_renderer_remove_constraint(handle, constraint);
+ }
+
+ [DllImport("cogl2.dll")]
+ public static extern void cogl_renderer_set_driver(IntPtr o, Driver driver);
+
+ public void SetDriver(Driver driver)
+ {
+ cogl_renderer_set_driver(handle, driver);
+ }
+
+ [DllImport("cogl2.dll")]
+ public static extern void cogl_renderer_set_winsys_id(IntPtr o, WinsysID winsys_id);
+
+ public void SetWinsysId(WinsysID winsys_id)
+ {
+ cogl_renderer_set_winsys_id(handle, winsys_id);
+ }
+
+ }
+}
diff --git a/cogl-sharp/parse-gir.py b/cogl-sharp/parse-gir.py
index f231175f..f945de45 100755
--- a/cogl-sharp/parse-gir.py
+++ b/cogl-sharp/parse-gir.py
@@ -28,6 +28,7 @@ object_types = (
"Onscreen",
"OnscreenTemplate",
"Pipeline",
+ "Renderer",
"SwapChain",
"Texture",
)
@@ -79,7 +80,12 @@ name_overrides = {
},
'PixelFormat': {
'uppercase': 1
- }
+ },
+ 'Renderer': {
+ 'handwritten': (
+ 'check_onscreen_template', 'connect'
+ )
+ },
}
basic_types_map = {