Texture2D.cs 925 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.InteropServices;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace BansheeEngine
  8. {
  9. public sealed class Texture2D : ScriptObject
  10. {
  11. public Texture2D(TextureFormat format, int width, int height, bool hasMipmaps = false, bool gammaCorrection = false)
  12. {
  13. Internal_CreateInstance(this, format, width, height, hasMipmaps, gammaCorrection);
  14. }
  15. ~Texture2D()
  16. {
  17. Internal_DestroyInstance(mCachedPtr);
  18. }
  19. [DllImport("__Internal")]
  20. private static extern void Internal_CreateInstance(Texture2D instance, TextureFormat format, int width, int height, bool hasMipmaps, bool gammaCorrection);
  21. [DllImport("__Internal")]
  22. private static extern void Internal_DestroyInstance(IntPtr nativeInstance);
  23. }
  24. }