Skip to content

Instantly share code, notes, and snippets.

Created December 20, 2017 08:43
Show Gist options
  • Save anonymous/1b39d10c71a5bfe754be1c8188f10814 to your computer and use it in GitHub Desktop.
Save anonymous/1b39d10c71a5bfe754be1c8188f10814 to your computer and use it in GitHub Desktop.
[StructLayout(LayoutKind.Sequential)]
public struct GbColor
{
public byte R;
public byte G;
public byte B;
}
private readonly GbColor[] _framebuffer = new GbColor[160 * 144];
// ... rendering
GL.Clear(ClearBufferMask.ColorBufferBit);
GL.RasterPos2(-1, 1);
GL.PixelZoom(1, -1);
GL.DrawPixels(160, 144, PixelFormat.Rgb, PixelType.UnsignedByte, _framebuffer);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment