private void AddToCollectionTwoInternalTwoRenderTargetsAndOneTexture(IGpuSurfaceCollection collection) { collection.Add(0, new GpuSurface { Type = GpuSurfaceType.Internal | GpuSurfaceType.Texture }); collection.Add(1, new GpuSurface { Type = GpuSurfaceType.Undefined }); collection.Add(2, new GpuSurface { Type = GpuSurfaceType.RenderTarget }); collection.Add(3, new GpuSurface { Type = GpuSurfaceType.RenderTarget }); collection.Add(4, new GpuSurface { Type = GpuSurfaceType.Texture }); }
public ITexture GenerateTextureFromStream(Stream stream, bool isFrameworkInternal, bool isFontTexture, SamplerType samplerType, bool generateMipMaps) { var veldridTexture = _imageSharpLoader.GenerateVeldridTextureFromStream(stream, generateMipMaps); var id = _idGenerator.New(); var surface = _gpuSurfaceFactory.CreateGpuSurfaceFromTexture(veldridTexture, isFrameworkInternal, isFontTexture, samplerType); return(_surfaceCollection.Add(id, surface) ? new TextureReference(id) : null); }