mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-26 13:05:03 +00:00
Custom cursors on X11.
This commit is contained in:
parent
6e23a55f35
commit
9239fd08e3
|
@ -1472,7 +1472,23 @@ namespace OpenTK.Platform.X11
|
|||
}
|
||||
set
|
||||
{
|
||||
Debug.Print("[Warning] X11GLNative.Cursor property not implemented");
|
||||
unsafe
|
||||
{
|
||||
using (new XLock(window.Display))
|
||||
{
|
||||
fixed(byte* pixels = value.Rgba)
|
||||
{
|
||||
var xcursorimage = Functions.XcursorImageCreate(32, 32);
|
||||
xcursorimage->xhot = (uint)value.X;
|
||||
xcursorimage->yhot = (uint)value.Y;
|
||||
xcursorimage->pixels = (uint*)pixels;
|
||||
xcursorimage->delay = 0;
|
||||
var xcursor = Functions.XcursorImageLoadCursor(window.Display, xcursorimage);
|
||||
Functions.XDefineCursor(window.Display, window.Handle, xcursor);
|
||||
Functions.XcursorImageDestroy(xcursorimage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue