I can't seem to figure out how to do this. I have a small section of code in c++ and I need to have the same in C#. Here is the c++ code:
struct Texel { unsigned char r, g, b, a; };
Texel mytexturedata[] =
{
{0x00, 0xFF, 0x00, 0xFF}, // green
{0xFF, 0xFF, 0x00, 0xFF}, // yellow
{0xFF, 0x00, 0x00, 0xFF}, // red
};
How do you do this is c#?
Thanks!
Texel[] mytexturedata = { new Texel() { r = 0x00, g=0xFF, b=0x00,a=0xFF} , .. };with the change ofclass Texel { byte r {get;set;} byte g {get;set;} byte b {get;set;} byte a {get;set;} }. BTW,unsigned charcorresponds tobytein C#,charis 16-bit wide (UTF-16).