Exemple #1
0
        public Texture(Device device, string name, Size size)
        {
            RawTexture = new D3D.Texture(device.RawDevice, (int)size.Width, (int)size.Height, 1, D3D.Usage.RenderTarget,
                D3D.Format.A8R8G8B8, D3D.Pool.Default);

            Name = name;
            Width = (int)size.Width;
            Height = (int)size.Height;
            this.imageFileFormat = D3D.ImageFileFormat.Bmp;
        }
Exemple #2
0
        public Texture(Device device, Stream stream, string name)
        {
            var imgInfo = D3D.ImageInformation.FromStream(stream);
            RawTexture = D3D.Texture.FromStream(device.RawDevice, stream, (int)(stream.Length - stream.Position),
                                                imgInfo.Width, imgInfo.Height,
                                                1,
                                                D3D.Usage.None,
                                                D3D.Format.Unknown,
                                                D3D.Pool.Default,
                                                D3D.Filter.Default,
                                                D3D.Filter.Default,
                                                new Color(1.0f, 0.0f, 1.0f, 0.0f).ToArgb());

            Name = name;
            Width = imgInfo.Width;
            Height = imgInfo.Height;
            this.imageFileFormat = imgInfo.ImageFileFormat;
        }
Exemple #3
0
        public Texture(Device device, string filePath, string name)
        {
            var imgInfo = D3D.ImageInformation.FromFile(filePath);

            RawTexture = D3D.Texture.FromFile(device.RawDevice, filePath,
                                              imgInfo.Width, imgInfo.Height,
                                              1,
                                              D3D.Usage.None,
                                              D3D.Format.Unknown,
                                              D3D.Pool.Default,
                                              D3D.Filter.Default,
                                              D3D.Filter.Default,
                                              new Color(1.0f, 0.0f, 1.0f, 0.0f).ToArgb());
            Name = name;
            Width = imgInfo.Width;
            Height = imgInfo.Height;
            this.imageFileFormat = imgInfo.ImageFileFormat;
        }