public TextureObject(string name,Texture2D texture, bool copyData = false)
 {
     _ready = true;
     if (copyData)
     {
         _texture = new Texture2D(texture.GraphicsDevice, texture.Width, texture.Height);
         Data.Scenes.Color[] rawData = new Data.Scenes.Color[texture.Height * texture.Width];
         texture.GetData(rawData);
         _texture.SetData(rawData);
         rawData = null;
     }
     else
         _texture = texture;
     _name = name;
 }
示例#2
0
 public TextureObject(string name, Texture2D texture, bool copyData = false)
 {
     _ready = true;
     if (copyData)
     {
         _texture = new Texture2D(texture.GraphicsDevice, texture.Width, texture.Height);
         Data.Scenes.Color[] rawData = new Data.Scenes.Color[texture.Height * texture.Width];
         texture.GetData(rawData);
         _texture.SetData(rawData);
         rawData = null;
     }
     else
     {
         _texture = texture;
     }
     _name = name;
 }