// WARNING - AUTOGENERATED - DO NOT EDIT // // Generated using `sharpie urho` // // Texture2DArray.cs // // Copyright 2015 Xamarin Inc. All rights reserved. using System; using System.Runtime.InteropServices; using System.Collections.Generic; using Urho.Urho2D; using Urho.Gui; using Urho.Resources; using Urho.IO; using Urho.Navigation; using Urho.Network; namespace Urho { /// /// 2D texture array resource. /// public unsafe partial class Texture2DArray : Texture { unsafe partial void OnTexture2DArrayCreated (); [Preserve] public Texture2DArray (IntPtr handle) : base (handle) { OnTexture2DArrayCreated (); } [Preserve] protected Texture2DArray (UrhoObjectFlag emptyFlag) : base (emptyFlag) { OnTexture2DArrayCreated (); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern int Texture2DArray_GetType (IntPtr handle); private StringHash UrhoGetType () { Runtime.ValidateRefCounted (this); return new StringHash (Texture2DArray_GetType (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr Texture2DArray_GetTypeName (IntPtr handle); private string GetTypeName () { Runtime.ValidateRefCounted (this); return Marshal.PtrToStringAnsi (Texture2DArray_GetTypeName (handle)); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern int Texture2DArray_GetTypeStatic (); private static StringHash GetTypeStatic () { Runtime.Validate (typeof(Texture2DArray)); return new StringHash (Texture2DArray_GetTypeStatic ()); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr Texture2DArray_GetTypeNameStatic (); private static string GetTypeNameStatic () { Runtime.Validate (typeof(Texture2DArray)); return Marshal.PtrToStringAnsi (Texture2DArray_GetTypeNameStatic ()); } [Preserve] public Texture2DArray () : this (Application.CurrentContext) { } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr Texture2DArray_Texture2DArray (IntPtr context); [Preserve] public Texture2DArray (Context context) : base (UrhoObjectFlag.Empty) { Runtime.Validate (typeof(Texture2DArray)); handle = Texture2DArray_Texture2DArray ((object)context == null ? IntPtr.Zero : context.Handle); Runtime.RegisterObject (this); OnTexture2DArrayCreated (); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern void Texture2DArray_RegisterObject (IntPtr context); /// /// Register object factory. /// public static void RegisterObject (Context context) { Runtime.Validate (typeof(Texture2DArray)); Texture2DArray_RegisterObject ((object)context == null ? IntPtr.Zero : context.Handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_BeginLoad_File (IntPtr handle, IntPtr source); /// /// Load resource from stream. May be called from a worker thread. Return true if successful. /// public override bool BeginLoad (File source) { Runtime.ValidateRefCounted (this); return Texture2DArray_BeginLoad_File (handle, (object)source == null ? IntPtr.Zero : source.Handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_BeginLoad_MemoryBuffer (IntPtr handle, IntPtr source); /// /// Load resource from stream. May be called from a worker thread. Return true if successful. /// public override bool BeginLoad (MemoryBuffer source) { Runtime.ValidateRefCounted (this); return Texture2DArray_BeginLoad_MemoryBuffer (handle, (object)source == null ? IntPtr.Zero : source.Handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_EndLoad (IntPtr handle); /// /// Finish resource loading. Always called from the main thread. Return true if successful. /// public override bool EndLoad () { Runtime.ValidateRefCounted (this); return Texture2DArray_EndLoad (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern void Texture2DArray_OnDeviceLost (IntPtr handle); /// /// Mark the GPU resource destroyed on context destruction. /// public void OnDeviceLost () { Runtime.ValidateRefCounted (this); Texture2DArray_OnDeviceLost (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern void Texture2DArray_OnDeviceReset (IntPtr handle); /// /// Recreate the GPU resource and restore data if applicable. /// public void OnDeviceReset () { Runtime.ValidateRefCounted (this); Texture2DArray_OnDeviceReset (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern void Texture2DArray_Release (IntPtr handle); /// /// Release the texture. /// public void Release () { Runtime.ValidateRefCounted (this); Texture2DArray_Release (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern void Texture2DArray_SetLayers (IntPtr handle, uint layers); /// /// Set the number of layers in the texture. To be used before SetData. /// private void SetLayers (uint layers) { Runtime.ValidateRefCounted (this); Texture2DArray_SetLayers (handle, layers); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_SetSize (IntPtr handle, uint layers, int width, int height, uint format, TextureUsage usage); /// /// Set layers, size, format and usage. Set layers to zero to leave them unchanged. Return true if successful. /// public bool SetSize (uint layers, int width, int height, uint format, TextureUsage usage = TextureUsage.Static) { Runtime.ValidateRefCounted (this); return Texture2DArray_SetSize (handle, layers, width, height, format, usage); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_SetData (IntPtr handle, uint layer, uint level, int x, int y, int width, int height, void* data); /// /// Set data either partially or fully on a layer's mip level. Return true if successful. /// public bool SetData (uint layer, uint level, int x, int y, int width, int height, void* data) { Runtime.ValidateRefCounted (this); return Texture2DArray_SetData (handle, layer, level, x, y, width, height, data); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_SetData0_File (IntPtr handle, uint layer, IntPtr source); /// /// Set data of one layer from a stream. Return true if successful. /// public bool SetData (uint layer, File source) { Runtime.ValidateRefCounted (this); return Texture2DArray_SetData0_File (handle, layer, (object)source == null ? IntPtr.Zero : source.Handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_SetData0_MemoryBuffer (IntPtr handle, uint layer, IntPtr source); /// /// Set data of one layer from a stream. Return true if successful. /// public bool SetData (uint layer, MemoryBuffer source) { Runtime.ValidateRefCounted (this); return Texture2DArray_SetData0_MemoryBuffer (handle, layer, (object)source == null ? IntPtr.Zero : source.Handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_SetData1 (IntPtr handle, uint layer, IntPtr image, bool useAlpha); /// /// Set data of one layer from an image. Return true if successful. Optionally make a single channel image alpha-only. /// public bool SetData (uint layer, Image image, bool useAlpha = false) { Runtime.ValidateRefCounted (this); return Texture2DArray_SetData1 (handle, layer, (object)image == null ? IntPtr.Zero : image.Handle, useAlpha); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern uint Texture2DArray_GetLayers (IntPtr handle); /// /// Return number of layers in the texture. /// private uint GetLayers () { Runtime.ValidateRefCounted (this); return Texture2DArray_GetLayers (handle); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern bool Texture2DArray_GetData (IntPtr handle, uint layer, uint level, IntPtr dest); /// /// Get data from a mip level. The destination buffer must be big enough. Return true if successful. /// public bool GetData (uint layer, uint level, IntPtr dest) { Runtime.ValidateRefCounted (this); return Texture2DArray_GetData (handle, layer, level, dest); } [DllImport (Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)] internal static extern IntPtr Texture2DArray_GetRenderSurface (IntPtr handle); /// /// Return render surface. /// private RenderSurface GetRenderSurface () { Runtime.ValidateRefCounted (this); return Runtime.LookupRefCounted (Texture2DArray_GetRenderSurface (handle)); } public override StringHash Type { get { return UrhoGetType (); } } public override string TypeName { get { return GetTypeName (); } } [Preserve] public new static StringHash TypeStatic { get { return GetTypeStatic (); } } public new static string TypeNameStatic { get { return GetTypeNameStatic (); } } /// /// Return number of layers in the texture. /// Or /// Set the number of layers in the texture. To be used before SetData. /// public uint Layers { get { return GetLayers (); } set { SetLayers (value); } } /// /// Return render surface. /// public RenderSurface RenderSurface { get { return GetRenderSurface (); } } } }