[cogl/wip/cogl-sharp: 40/51] cogl-sharp: Expose Renderer
- From: Damien Lespiau <dlespiau src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [cogl/wip/cogl-sharp: 40/51] cogl-sharp: Expose Renderer
- Date: Sat, 5 Jan 2013 16:51:39 +0000 (UTC)
commit 57f1ff6432e86cccecfa3fe38f09c8c114d4542f
Author: Damien Lespiau <damien lespiau intel com>
Date: Sun Nov 4 00:41:12 2012 +0000
cogl-sharp: Expose Renderer
cogl-sharp/Makefile.am | 2 +
cogl-sharp/Renderer.cs | 73 +++++++++++++++++++++++++++++++++++++++++++++++
cogl-sharp/_Renderer.cs | 66 ++++++++++++++++++++++++++++++++++++++++++
cogl-sharp/parse-gir.py | 8 ++++-
4 files changed, 148 insertions(+), 1 deletions(-)
---
diff --git a/cogl-sharp/Makefile.am b/cogl-sharp/Makefile.am
index 499a229..16c340d 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 0000000..e01fba6
--- /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 0000000..8fb1350
--- /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 f231175..f945de4 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 = {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]