Skip to content

Instantly share code, notes, and snippets.

Created May 11, 2013 23:14
Show Gist options
  • Save anonymous/5561765 to your computer and use it in GitHub Desktop.
Save anonymous/5561765 to your computer and use it in GitHub Desktop.
public void Paint(IntPtr srcBuffer, int srcRowSpan, AweRect srcRect, AweRect destRect)
{
var graphics = GameSession.Current.Services.Get<GraphicsManager>();
var pixelSize = srcRowSpan / srcRect.Width; //4
var stream = new DataStream(srcBuffer, srcRect.Width * srcRect.Height * pixelSize, true, false);
var box = new DataBox(srcRowSpan, 0, stream);
graphics.Device.ImmediateContext.UpdateSubresource(box, texture, 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment