The code:
Pixel = new Texture2D(PlayerDmgShip.GraphicsDevice, 1, 1);
try
{
Pixel.SetData(new[] { ConsoleColor.White });
}
catch(Exception e)
{
System.Console.WriteLine("Pixel Error: " + e.ToString());
}
Error code:
03-18 14:06:52.374 I/mono-stdout(11022): Pixel Error: System.ArgumentException: Type ConsoleColor cannot be marshaled as an unmanaged structure.
Parameter name: t
at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:SizeOf (System.Type)
at Microsoft.Xna.Framework.Graphics.Texture2D+<>c__DisplayClass5`1[System.ConsoleColor].<SetData>b__4 () [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Threading.BlockOnUIThread (System.Action action) [0x00000] in <filename unknown>:0
03-18 14:06:52.374 I/mono-stdout(11022): Parameter name: t
at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[ConsoleColor] (Int32 level, Nullable`1 rect, System.ConsoleColor[] data, Int32 startIndex, Int32 elementCount) [0x00000] in <filename unknown>:0
at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[ConsoleColor] (System.ConsoleColor[] data) [0x00000] in <filename unknown>:0
at NeonShooter.Art.Load (Microsoft.Xna.Framework.Content.ContentManager content) [0x0013a] in c:\Users\suj12filip\Documents\GitHub\NeonShooter\NeonShooter\Art.cs:77
03-18 14:06:52.374 I/mono-stdout(11022): at (wrapper managed-to-native) System.Runtime.InteropServices.Marshal:SizeOf (System.Type)
03-18 14:06:52.374 I/mono-stdout(11022): at Microsoft.Xna.Framework.Graphics.Texture2D+<>c__DisplayClass5`1[System.ConsoleColor].<SetData>b__4 () [0x00000] in <filename unknown>:0
03-18 14:06:52.374 I/mono-stdout(11022): at Microsoft.Xna.Framework.Threading.BlockOnUIThread (System.Action action) [0x00000] in <filename unknown>:0
03-18 14:06:52.374 I/mono-stdout(11022): at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[ConsoleColor] (Int32 level, Nullable`1 rect, System.ConsoleColor[] data, Int32 startIndex, Int32 elementCount) [0x00000] in <filename unknown>:0
03-18 14:06:52.384 I/mono-stdout(11022): at Microsoft.Xna.Framework.Graphics.Texture2D.SetData[ConsoleColor] (System.ConsoleColor[] data) [0x00000] in <filename unknown>:0
03-18 14:06:52.384 I/mono-stdout(11022): at NeonShooter.Art.Load (Microsoft.Xna.Framework.Content.ContentManager content) [0x0013a] in c:\Users\suj12filip\Documents\GitHub\NeonShooter\NeonShooter\Art.cs:77