public void SetCloseCallback(ULCloseCallback callback, IntPtr userData = default) { if (callback is not null) { ULCloseCallback__PInvoke__ callback__PInvoke__ = (user_data, window) => callback(user_data, new ULWindow(window)); if (handles[0].IsAllocated) { handles[0].Free(); } handles[0] = GCHandle.Alloc(callback__PInvoke__, GCHandleType.Normal); AppCoreMethods.ulWindowSetCloseCallback(Ptr, callback__PInvoke__, userData); } else { if (handles[0].IsAllocated) { handles[0].Free(); } handles[0] = default; AppCoreMethods.ulWindowSetCloseCallback(Ptr, null, userData); } }
public ULOverlay(ULWindow window, View view, int x = 0, int y = 0) { Ptr = AppCoreMethods.ulCreateOverlayWithView(window.Ptr, view.Ptr, x, y); }
public ULOverlay(ULWindow window, uint width, uint height, int x = 0, int y = 0) { Ptr = AppCoreMethods.ulCreateOverlay(window.Ptr, width, height, x, y); }
public ULWindow(ULMonitor monitor, uint width, uint height, bool fullscreen, ULWindowFlags flags) { Ptr = AppCoreMethods.ulCreateWindow(monitor.Ptr, width, height, fullscreen, flags); }
public void MoveToCenter() => AppCoreMethods.ulWindowMoveToCenter(Ptr);
public void MoveTo(int x, int y) => AppCoreMethods.ulWindowMoveTo(Ptr, x, y);
public ULSettings(bool dispose = true) { IsDisposed = !dispose; Ptr = AppCoreMethods.ulCreateSettings(); }