Graphics.cs 861 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Urho
  4. {
  5. public partial class Graphics
  6. {
  7. [DllImport(Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  8. static extern IntPtr Graphics_GetSdlWindow(IntPtr graphics);
  9. /// <summary>
  10. /// Pointer to SDL window
  11. /// </summary>
  12. public IntPtr SdlWindow => Graphics_GetSdlWindow(Handle);
  13. [DllImport(Consts.NativeImport, CallingConvention = CallingConvention.Cdecl)]
  14. internal extern static IntPtr Graphics_GetMultiSampleLevels(IntPtr target, out int count);
  15. public int[] MultiSampleLevels
  16. {
  17. get
  18. {
  19. Runtime.ValidateRefCounted(this);
  20. int count;
  21. var ptr = Graphics_GetMultiSampleLevels(Handle, out count);
  22. if (ptr == IntPtr.Zero)
  23. return new int[0];
  24. var res = new int[count];
  25. Marshal.Copy(ptr, res, 0, count);
  26. return res;
  27. }
  28. }
  29. }
  30. }