public Texture2D(int Width, int Height, byte[] Data) { this.Width = Width; this.Height = Height; this.TexWidth_ = Width - 1; this.TexHeight_ = Height - 1; Pixels_ = new Colorf[Height][]; PixelsVec_ = new Vector <double> [Width * Height]; for (var Y = 0; Y < Height; ++Y) { Pixels_[Y] = new Colorf[Width]; for (var X = 0; X < Width; ++X) { var Index = (Y * Width + X) << 2; Pixels_[Y][X] = new Colorf(Data[Index + 2] / 255.0f, Data[Index + 1] / 255.0f, Data[Index + 0] / 255.0f, Data[Index + 3] / 255.0f); PixelsVec_[Index >> 2] = new Vector <double>(new double[] { Data[Index + 2] / 255.0d, Data[Index + 1] / 255.0d, Data[Index + 0] / 255.0d, Data[Index + 3] / 255.0d }); } } unsafe { PixelsVecPointer_ = (double *)Unsafe.AsPointer(ref PixelsVec_[0]); } WarpMode_ = TextureWarpMode.Repeat; BorderColor_ = Colorf.Black; FilterMode_ = TextureFilterMode.Linear; }
public void SetWarpMode(TextureWarpMode WarpMode) { WarpMode_ = WarpMode; }