private Texture2D(ProcessedTexture processedTexture, uint resourceSetNo, string textureName, string samplerName)
 {
     ResourceSetNo    = resourceSetNo;
     TextureName      = textureName;
     SamplerName      = samplerName;
     ProcessedTexture = processedTexture;
 }
 public static ITexture2D Create(
     ProcessedTexture processedTexture,
     uint resourceSetNo,
     string textureName,
     string samplerName)
 {
     return(new Texture2D(processedTexture, resourceSetNo, textureName, samplerName));
 }
Beispiel #3
0
        public void Start()
        {
            _renderer             = _runner.GetSubSystem <Sdl2Renderer>();
            _ui                   = _runner.GetSubSystem <Ui>();
            _loadingScreenTexture = _runner.GetSubSystem <ResourceLoader>().LoadEmbeddedAsset <ProcessedTexture>(_splashScreen);

            _loadingTexture     = _loadingScreenTexture.CreateDeviceTexture(_renderer.GraphicsDevice, _renderer.ResourceFactory, TextureUsage.Sampled);
            _loadingTextureView = _renderer.ResourceFactory.CreateTextureView(_loadingTexture);

            _loadingScreen = new LoadingScreen(_ui.GetOrCreateImGuiBinding(_renderer.ResourceFactory, _loadingTextureView));

            _ui.Windows.Add(_loadingScreen);

            LoadScene(new MenuScene());
        }
        private Texture GetGraphicsDataAsDeviceTexture(string path)
        {
            using var reader = new BinaryReader(File.Open(path, FileMode.Open));
            var texture = new ProcessedTexture(
                reader.ReadEnum <PixelFormat>(),
                reader.ReadEnum <TextureType>(),
                reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadByteArray());

            return(texture.CreateDeviceTexture(GraphicsDevice, ResourceFactory, TextureUsage.Sampled));
        }
 public TexturedCube(ApplicationWindow window) : base(window)
 {
     _stoneTexData = LoadEmbeddedAsset <ProcessedTexture>("spnza_bricks_a_diff.binary");
     _vertices     = GetCubeVertices();
     _indices      = GetCubeIndices();
 }
Beispiel #6
0
        public Image(string filename)
        {
            Settings = Gui.Settings.DefaultControlSettings.Copy();

            ProcessedTexture = LoadFileAsset <ProcessedTexture>(filename);
        }