[cogl/wip/cogl-sharp: 21/30] cogl-sharp: Start adding Texture into the mix



commit 08891f5e04f9f4097bb18fa314fc212155c71819
Author: Damien Lespiau <damien lespiau intel com>
Date:   Tue Oct 2 23:59:02 2012 +0100

    cogl-sharp: Start adding Texture into the mix

 cogl-sharp/Makefile.am     |    2 ++
 cogl-sharp/Texture.cs      |   36 ++++++++++++++++++++++++++++++++++++
 cogl-sharp/_FrameBuffer.cs |    9 +++++++++
 cogl-sharp/_Pipeline.cs    |   17 +++++++++++++++++
 cogl-sharp/_Texture.cs     |   26 ++++++++++++++++++++++++++
 cogl-sharp/parse-gir.py    |    1 +
 6 files changed, 91 insertions(+), 0 deletions(-)
---
diff --git a/cogl-sharp/Makefile.am b/cogl-sharp/Makefile.am
index f43f891..9eaeec6 100644
--- a/cogl-sharp/Makefile.am
+++ b/cogl-sharp/Makefile.am
@@ -25,6 +25,8 @@ sources =			\
 	PipelineFilter.cs	\
 	PipelineWrapMode.cs	\
 	PixelFormat.cs		\
+	Texture.cs		\
+	_Texture.cs		\
 	VerticesMode.cs		\
 	Winding.cs		\
 	AssemblyInfo.cs		\
diff --git a/cogl-sharp/Texture.cs b/cogl-sharp/Texture.cs
new file mode 100644
index 0000000..c491ec7
--- /dev/null
+++ b/cogl-sharp/Texture.cs
@@ -0,0 +1,36 @@
+/*
+ * 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 Texture : Cogl.Object
+    {
+        public Texture(IntPtr h) : base(h) {}
+        public Texture() {}
+    }
+}
diff --git a/cogl-sharp/_FrameBuffer.cs b/cogl-sharp/_FrameBuffer.cs
index 4227929..dc0c5e9 100644
--- a/cogl-sharp/_FrameBuffer.cs
+++ b/cogl-sharp/_FrameBuffer.cs
@@ -95,6 +95,15 @@ namespace Cogl
         }
 
         [DllImport("cogl2.dll")]
+        public static extern IntPtr cogl_framebuffer_get_depth_texture(IntPtr o);
+
+        public Texture GetDepthTexture()
+        {
+            IntPtr p = cogl_framebuffer_get_depth_texture(handle);
+            return new Texture(p);
+        }
+
+        [DllImport("cogl2.dll")]
         public static extern PixelFormat cogl_framebuffer_get_color_format(IntPtr o);
 
         public PixelFormat GetColorFormat()
diff --git a/cogl-sharp/_Pipeline.cs b/cogl-sharp/_Pipeline.cs
index 9f7672b..9c98a3d 100644
--- a/cogl-sharp/_Pipeline.cs
+++ b/cogl-sharp/_Pipeline.cs
@@ -80,6 +80,15 @@ namespace Cogl
         }
 
         [DllImport("cogl2.dll")]
+        public static extern IntPtr cogl_pipeline_get_layer_texture(IntPtr o, int layer_index);
+
+        public Texture GetLayerTexture(int layer_index)
+        {
+            IntPtr p = cogl_pipeline_get_layer_texture(handle, layer_index);
+            return new Texture(p);
+        }
+
+        [DllImport("cogl2.dll")]
         public static extern PipelineWrapMode cogl_pipeline_get_layer_wrap_mode_p(IntPtr o, int layer_index);
 
         public PipelineWrapMode GetLayerWrapModeP(int layer_index)
@@ -208,6 +217,14 @@ namespace Cogl
         }
 
         [DllImport("cogl2.dll")]
+        public static extern void cogl_pipeline_set_layer_texture(IntPtr o, int layer_index, IntPtr texture);
+
+        public void SetLayerTexture(int layer_index, Texture texture)
+        {
+            cogl_pipeline_set_layer_texture(handle, layer_index, texture.Handle);
+        }
+
+        [DllImport("cogl2.dll")]
         public static extern void cogl_pipeline_set_layer_wrap_mode(IntPtr o, int layer_index, PipelineWrapMode mode);
 
         public void SetLayerWrapMode(int layer_index, PipelineWrapMode mode)
diff --git a/cogl-sharp/_Texture.cs b/cogl-sharp/_Texture.cs
new file mode 100644
index 0000000..4937c38
--- /dev/null
+++ b/cogl-sharp/_Texture.cs
@@ -0,0 +1,26 @@
+/* This file has been generated by parse-gir.py, do not hand edit */
+using System;
+using System.Runtime.InteropServices;
+
+namespace Cogl
+{
+    public partial class Texture
+    {
+        [DllImport("cogl2.dll")]
+        public static extern PixelFormat cogl_texture_get_format(IntPtr o);
+
+        public PixelFormat GetFormat()
+        {
+            return cogl_texture_get_format(handle);
+        }
+
+        [DllImport("cogl2.dll")]
+        public static extern int cogl_texture_get_max_waste(IntPtr o);
+
+        public int GetMaxWaste()
+        {
+            return cogl_texture_get_max_waste(handle);
+        }
+
+    }
+}
diff --git a/cogl-sharp/parse-gir.py b/cogl-sharp/parse-gir.py
index ee46222..0748917 100755
--- a/cogl-sharp/parse-gir.py
+++ b/cogl-sharp/parse-gir.py
@@ -22,6 +22,7 @@ enum_types = (
 object_types = (
     "Framebuffer",
     "Pipeline",
+    "Texture",
 )
 
 # The struct types (value types) are written by hand



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