mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 13:25:28 +00:00
Copy to correct offset.
Offset into image is y * stride, not y * bpp.
This commit is contained in:
parent
5b4f75ab68
commit
2bb0f945f9
|
@ -32,8 +32,9 @@ namespace Examples.Tutorial
|
||||||
for (int y = 0; y < bitmap.Height; ++y)
|
for (int y = 0; y < bitmap.Height; ++y)
|
||||||
{
|
{
|
||||||
var offset = new IntPtr(data.Scan0.ToInt64() + (data.Stride * y));
|
var offset = new IntPtr(data.Scan0.ToInt64() + (data.Stride * y));
|
||||||
|
var stride = bitmap.Width * 4;
|
||||||
System.Runtime.InteropServices.Marshal.Copy(
|
System.Runtime.InteropServices.Marshal.Copy(
|
||||||
offset, rgba, y * 4, bitmap.Width * 4);
|
offset, rgba, y * stride, stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
var cursor = new OpenTK.MouseCursor(rgba, bitmap.Width, bitmap.Height, 0, 0);
|
var cursor = new OpenTK.MouseCursor(rgba, bitmap.Width, bitmap.Height, 0, 0);
|
||||||
|
|
Loading…
Reference in a new issue