diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2012-10-03 10:55:22 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2013-01-04 20:29:35 +0000 |
commit | 4b99779e616bbc1b78e891649ca9a259a7b74a79 (patch) | |
tree | d7c2b30cde1b003882e1f3f36f957d70ede92956 | |
parent | 185909f92c11786d8d43dd24f85cf600243dbb33 (diff) | |
download | cogl-4b99779e616bbc1b78e891649ca9a259a7b74a79.tar.gz |
cogl-sharp: Expose TextureType
TextureType has a tiny problem: it tries to define 2D and 3D as enum
values. Let's hand write the enum for now to Texture2D and Texture3D.
This allows to expose Framebuffer.SetLayerNullTexture()
-rw-r--r-- | cogl-sharp/Makefile.am | 1 | ||||
-rw-r--r-- | cogl-sharp/TextureType.cs | 12 | ||||
-rw-r--r-- | cogl-sharp/_Pipeline.cs | 8 | ||||
-rwxr-xr-x | cogl-sharp/parse-gir.py | 10 |
4 files changed, 30 insertions, 1 deletions
diff --git a/cogl-sharp/Makefile.am b/cogl-sharp/Makefile.am index 9eaeec64..0a686c38 100644 --- a/cogl-sharp/Makefile.am +++ b/cogl-sharp/Makefile.am @@ -27,6 +27,7 @@ sources = \ PixelFormat.cs \ Texture.cs \ _Texture.cs \ + TextureType.cs \ VerticesMode.cs \ Winding.cs \ AssemblyInfo.cs \ diff --git a/cogl-sharp/TextureType.cs b/cogl-sharp/TextureType.cs new file mode 100644 index 00000000..d2fa39bd --- /dev/null +++ b/cogl-sharp/TextureType.cs @@ -0,0 +1,12 @@ +/* This file has been generated by parse-gir.py, do not hand edit */ +using System; + +namespace Cogl +{ + public enum TextureType + { + Texture2D = 0, + Texture3D = 1, + TextureRectangle = 2 + } +} diff --git a/cogl-sharp/_Pipeline.cs b/cogl-sharp/_Pipeline.cs index 70dd7cbf..027b6717 100644 --- a/cogl-sharp/_Pipeline.cs +++ b/cogl-sharp/_Pipeline.cs @@ -225,6 +225,14 @@ namespace Cogl } [DllImport("cogl2.dll")] + public static extern void cogl_pipeline_set_layer_null_texture(IntPtr o, int layer_index, TextureType texure_type); + + public void SetLayerNullTexture(int layer_index, TextureType texure_type) + { + cogl_pipeline_set_layer_null_texture(handle, layer_index, texure_type); + } + + [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) diff --git a/cogl-sharp/parse-gir.py b/cogl-sharp/parse-gir.py index 3153e401..e046c6aa 100755 --- a/cogl-sharp/parse-gir.py +++ b/cogl-sharp/parse-gir.py @@ -31,6 +31,10 @@ struct_types = ( 'Matrix' ) +hand_written_types = ( + 'TextureType' +) + # maps from .gir names to cogl-sharp types/methods name_overrides = { 'Framebuffer': { @@ -146,7 +150,8 @@ def known_type(gir_name): return (gir_name in enum_types or gir_name in object_types or gir_name in basic_types_map or - gir_name in struct_types) + gir_name in struct_types or + gir_name in hand_written_types) def is_pointer_type(c_type): return c_type.endswith("*") @@ -164,6 +169,9 @@ def derive_native_type(gir_type, c_type): if gir_type in enum_types: return gir_type + if gir_type in hand_written_types: + return gir_type + if gir_type in basic_types_map: return basic_types_map[gir_type] |