fna-workbench

fna-workbench Commit Details


Date:2016-03-18 13:56:52 (8 years 9 months ago)
Author:Ethan Lee
Branch:master
Commit:0d69d3a8939a38e140db493394383f157165f9bf
Parents: a7e003b1f859cba951f340fe626a3f99e3ca3622
Message:LocalAlloc the backbuffer temp block

Changes:

File differences

src/Graphics/OpenGLDevice.cs
31443144
31453145
31463146
3147
3148
3149
3147
31503148
31513149
31523150
......
31543152
31553153
31563154
3157
3155
31583156
31593157
31603158
// Now we get to do a software-based flip! Yes, really! -flibit
int pitch = w * 4;
byte[] tempRow = new byte[pitch];
GCHandle handle = GCHandle.Alloc(tempRow, GCHandleType.Pinned);
IntPtr temp = handle.AddrOfPinnedObject();
IntPtr temp = Marshal.AllocHGlobal(pitch);
for (int row = 0; row < h / 2; row += 1)
{
// Top to temp, bottom to top, temp to bottom
memcpy(data + (row * pitch), data + ((h - row - 1) * pitch), (IntPtr) pitch);
memcpy(data + ((h - row - 1) * pitch), temp, (IntPtr) pitch);
}
handle.Free();
Marshal.FreeHGlobal(temp);
}
[DllImport("msvcrt.dll", CallingConvention = CallingConvention.Cdecl)]
private static extern void memcpy(IntPtr dst, IntPtr src, IntPtr len);

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05558s using 13 queries.