aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-07-05 13:15:00 -0400
committerMichael <[email protected]>2017-07-05 13:15:00 -0400
commitde9bc8567b268e9659d174f65ce7dc23dff6fafe (patch)
treeb311f063400314c1ef7a348524935ff381d8253e /ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs
parente7b288968b8923eb5a7b9c358de75e521f1d8bde (diff)
downloadshiftos_thereturn-de9bc8567b268e9659d174f65ce7dc23dff6fafe.tar.gz
shiftos_thereturn-de9bc8567b268e9659d174f65ce7dc23dff6fafe.tar.bz2
shiftos_thereturn-de9bc8567b268e9659d174f65ce7dc23dff6fafe.zip
experimental stuff
Diffstat (limited to 'ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs')
-rw-r--r--ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs
index 43292c0..1ab45db 100644
--- a/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs
+++ b/ShiftOS.Frontend/GraphicsSubsystem/GraphicsContext.cs
@@ -165,6 +165,14 @@ namespace ShiftOS.Frontend.GraphicsSubsystem
System.Runtime.InteropServices.Marshal.Copy(lck.Scan0, data, 0, data.Length);
bmp.UnlockBits(lck);
var tex2 = new Texture2D(_graphicsDevice, bmp.Width, bmp.Height);
+ for(int i = 0; i < data.Length; i += 4)
+ {
+ byte r = data[i];
+ byte b = data[i + 2];
+ data[i] = b;
+ data[i + 2] = r;
+ }
+
tex2.SetData<byte>(data);
_spritebatch.Draw(tex2, new Rectangle(x, y, bmp.Width, bmp.Height), Color.White);
}