TextureCube.cs 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. // WARNING - AUTOGENERATED - DO NOT EDIT
  2. //
  3. // Generated using `sharpie urho`
  4. //
  5. // TextureCube.cs
  6. //
  7. // Copyright 2015 Xamarin Inc. All rights reserved.
  8. using System;
  9. using System.Runtime.InteropServices;
  10. using System.Collections.Generic;
  11. using Urho.Urho2D;
  12. using Urho.Gui;
  13. using Urho.Resources;
  14. using Urho.IO;
  15. using Urho.Navigation;
  16. using Urho.Network;
  17. namespace Urho
  18. {
  19. /// <summary>
  20. /// Cube texture resource.
  21. /// </summary>
  22. public unsafe partial class TextureCube : Texture
  23. {
  24. unsafe partial void OnTextureCubeCreated ();
  25. [Preserve]
  26. public TextureCube (IntPtr handle) : base (handle)
  27. {
  28. OnTextureCubeCreated ();
  29. }
  30. [Preserve]
  31. protected TextureCube (UrhoObjectFlag emptyFlag) : base (emptyFlag)
  32. {
  33. OnTextureCubeCreated ();
  34. }
  35. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  36. internal static extern int TextureCube_GetType (IntPtr handle);
  37. private StringHash UrhoGetType ()
  38. {
  39. Runtime.ValidateRefCounted (this);
  40. return new StringHash (TextureCube_GetType (handle));
  41. }
  42. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  43. internal static extern IntPtr TextureCube_GetTypeName (IntPtr handle);
  44. private string GetTypeName ()
  45. {
  46. Runtime.ValidateRefCounted (this);
  47. return Marshal.PtrToStringAnsi (TextureCube_GetTypeName (handle));
  48. }
  49. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  50. internal static extern int TextureCube_GetTypeStatic ();
  51. private static StringHash GetTypeStatic ()
  52. {
  53. Runtime.Validate (typeof(TextureCube));
  54. return new StringHash (TextureCube_GetTypeStatic ());
  55. }
  56. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  57. internal static extern IntPtr TextureCube_GetTypeNameStatic ();
  58. private static string GetTypeNameStatic ()
  59. {
  60. Runtime.Validate (typeof(TextureCube));
  61. return Marshal.PtrToStringAnsi (TextureCube_GetTypeNameStatic ());
  62. }
  63. [Preserve]
  64. public TextureCube () : this (Application.CurrentContext)
  65. {
  66. }
  67. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  68. internal static extern IntPtr TextureCube_TextureCube (IntPtr context);
  69. [Preserve]
  70. public TextureCube (Context context) : base (UrhoObjectFlag.Empty)
  71. {
  72. Runtime.Validate (typeof(TextureCube));
  73. handle = TextureCube_TextureCube ((object)context == null ? IntPtr.Zero : context.Handle);
  74. Runtime.RegisterObject (this);
  75. OnTextureCubeCreated ();
  76. }
  77. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  78. internal static extern void TextureCube_RegisterObject (IntPtr context);
  79. /// <summary>
  80. /// Register object factory.
  81. /// </summary>
  82. public static void RegisterObject (Context context)
  83. {
  84. Runtime.Validate (typeof(TextureCube));
  85. TextureCube_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle);
  86. }
  87. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  88. internal static extern bool TextureCube_BeginLoad_File (IntPtr handle, IntPtr source);
  89. /// <summary>
  90. /// Load resource from stream. May be called from a worker thread. Return true if successful.
  91. /// </summary>
  92. public override bool BeginLoad (File source)
  93. {
  94. Runtime.ValidateRefCounted (this);
  95. return TextureCube_BeginLoad_File (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  96. }
  97. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  98. internal static extern bool TextureCube_BeginLoad_MemoryBuffer (IntPtr handle, IntPtr source);
  99. /// <summary>
  100. /// Load resource from stream. May be called from a worker thread. Return true if successful.
  101. /// </summary>
  102. public override bool BeginLoad (MemoryBuffer source)
  103. {
  104. Runtime.ValidateRefCounted (this);
  105. return TextureCube_BeginLoad_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle);
  106. }
  107. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  108. internal static extern bool TextureCube_EndLoad (IntPtr handle);
  109. /// <summary>
  110. /// Finish resource loading. Always called from the main thread. Return true if successful.
  111. /// </summary>
  112. public override bool EndLoad ()
  113. {
  114. Runtime.ValidateRefCounted (this);
  115. return TextureCube_EndLoad (handle);
  116. }
  117. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  118. internal static extern void TextureCube_Release (IntPtr handle);
  119. /// <summary>
  120. /// Release the texture.
  121. /// </summary>
  122. public void Release ()
  123. {
  124. Runtime.ValidateRefCounted (this);
  125. TextureCube_Release (handle);
  126. }
  127. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  128. internal static extern bool TextureCube_SetSize (IntPtr handle, int size, uint format, TextureUsage usage, int multiSample);
  129. /// <summary>
  130. /// Set size, format, usage and multisampling parameter for rendertargets. Note that cube textures always use autoresolve when multisampled due to lacking support (on all APIs) to multisample them in a shader. Return true if successful.
  131. /// </summary>
  132. public bool SetSize (int size, uint format, TextureUsage usage = TextureUsage.Static, int multiSample = 1)
  133. {
  134. Runtime.ValidateRefCounted (this);
  135. return TextureCube_SetSize (handle, size, format, usage, multiSample);
  136. }
  137. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  138. internal static extern bool TextureCube_SetData (IntPtr handle, CubeMapFace face, uint level, int x, int y, int width, int height, void* data);
  139. /// <summary>
  140. /// Set data either partially or fully on a face's mip level. Return true if successful.
  141. /// </summary>
  142. public bool SetData (CubeMapFace face, uint level, int x, int y, int width, int height, void* data)
  143. {
  144. Runtime.ValidateRefCounted (this);
  145. return TextureCube_SetData (handle, face, level, x, y, width, height, data);
  146. }
  147. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  148. internal static extern bool TextureCube_SetData0_File (IntPtr handle, CubeMapFace face, IntPtr source);
  149. /// <summary>
  150. /// Set data of one face from a stream. Return true if successful.
  151. /// </summary>
  152. public bool SetData (CubeMapFace face, File source)
  153. {
  154. Runtime.ValidateRefCounted (this);
  155. return TextureCube_SetData0_File (handle, face, (object)source == null ? IntPtr.Zero : source.Handle);
  156. }
  157. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  158. internal static extern bool TextureCube_SetData0_MemoryBuffer (IntPtr handle, CubeMapFace face, IntPtr source);
  159. /// <summary>
  160. /// Set data of one face from a stream. Return true if successful.
  161. /// </summary>
  162. public bool SetData (CubeMapFace face, MemoryBuffer source)
  163. {
  164. Runtime.ValidateRefCounted (this);
  165. return TextureCube_SetData0_MemoryBuffer (handle, face, (object)source == null ? IntPtr.Zero : source.Handle);
  166. }
  167. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  168. internal static extern bool TextureCube_SetData1 (IntPtr handle, CubeMapFace face, IntPtr image, bool useAlpha);
  169. /// <summary>
  170. /// Set data of one face from an image. Return true if successful. Optionally make a single channel image alpha-only.
  171. /// </summary>
  172. public bool SetData (CubeMapFace face, Image image, bool useAlpha = false)
  173. {
  174. Runtime.ValidateRefCounted (this);
  175. return TextureCube_SetData1 (handle, face, (object)image == null ? IntPtr.Zero : image.Handle, useAlpha);
  176. }
  177. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  178. internal static extern bool TextureCube_GetData (IntPtr handle, CubeMapFace face, uint level, IntPtr dest);
  179. /// <summary>
  180. /// Get data from a face's mip level. The destination buffer must be big enough. Return true if successful.
  181. /// </summary>
  182. public bool GetData (CubeMapFace face, uint level, IntPtr dest)
  183. {
  184. Runtime.ValidateRefCounted (this);
  185. return TextureCube_GetData (handle, face, level, dest);
  186. }
  187. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  188. internal static extern IntPtr TextureCube_GetImage (IntPtr handle, CubeMapFace face);
  189. /// <summary>
  190. /// Get image data from a face's zero mip level. Only RGB and RGBA textures are supported.
  191. /// </summary>
  192. public Image GetImage (CubeMapFace face)
  193. {
  194. Runtime.ValidateRefCounted (this);
  195. return Runtime.LookupRefCounted<Image> (TextureCube_GetImage (handle, face));
  196. }
  197. [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  198. internal static extern IntPtr TextureCube_GetRenderSurface (IntPtr handle, CubeMapFace face);
  199. /// <summary>
  200. /// Return render surface for one face.
  201. /// </summary>
  202. public RenderSurface GetRenderSurface (CubeMapFace face)
  203. {
  204. Runtime.ValidateRefCounted (this);
  205. return Runtime.LookupRefCounted<RenderSurface> (TextureCube_GetRenderSurface (handle, face));
  206. }
  207. public override StringHash Type {
  208. get {
  209. return UrhoGetType ();
  210. }
  211. }
  212. public override string TypeName {
  213. get {
  214. return GetTypeName ();
  215. }
  216. }
  217. [Preserve]
  218. public new static StringHash TypeStatic {
  219. get {
  220. return GetTypeStatic ();
  221. }
  222. }
  223. public new static string TypeNameStatic {
  224. get {
  225. return GetTypeNameStatic ();
  226. }
  227. }
  228. }
  229. }