From 1148a00f294822eed68cde0bda173d258c98d30c Mon Sep 17 00:00:00 2001 From: Caleb Cornett Date: Sun, 22 Jan 2023 20:03:48 -0500 Subject: [PATCH] Use Texture.CreateTexture* instead of using TextureCreateInfo --- RenderTexture3D/RenderTexture3DGame.cs | 18 ++++++++---------- Texture3D/Texture3DGame.cs | 11 +---------- VertexSampler/VertexSamplerGame.cs | 11 +---------- 3 files changed, 10 insertions(+), 30 deletions(-) diff --git a/RenderTexture3D/RenderTexture3DGame.cs b/RenderTexture3D/RenderTexture3DGame.cs index 238ab04..d8f03fc 100644 --- a/RenderTexture3D/RenderTexture3DGame.cs +++ b/RenderTexture3D/RenderTexture3DGame.cs @@ -53,16 +53,14 @@ namespace MoonWorks.Test // Create and populate the GPU resources vertexBuffer = Buffer.Create(GraphicsDevice, BufferUsageFlags.Vertex, 4); indexBuffer = Buffer.Create(GraphicsDevice, BufferUsageFlags.Index, 6); - rt = new Texture(GraphicsDevice, new TextureCreateInfo - { - Width = 16, - Height = 16, - Depth = (uint) colors.Length, - Format = TextureFormat.R8G8B8A8, - IsCube = false, - LevelCount = 1, - UsageFlags = TextureUsageFlags.ColorTarget | TextureUsageFlags.Sampler - }); + rt = Texture.CreateTexture3D( + GraphicsDevice, + 16, + 16, + (uint) colors.Length, + TextureFormat.R8G8B8A8, + TextureUsageFlags.ColorTarget | TextureUsageFlags.Sampler + ); CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); cmdbuf.SetBufferData( diff --git a/Texture3D/Texture3DGame.cs b/Texture3D/Texture3DGame.cs index db7a9d4..b955629 100644 --- a/Texture3D/Texture3DGame.cs +++ b/Texture3D/Texture3DGame.cs @@ -49,16 +49,7 @@ namespace MoonWorks.Test // Create and populate the GPU resources vertexBuffer = Buffer.Create(GraphicsDevice, BufferUsageFlags.Vertex, 4); indexBuffer = Buffer.Create(GraphicsDevice, BufferUsageFlags.Index, 6); - texture = new Texture(GraphicsDevice, new TextureCreateInfo - { - Width = 16, - Height = 16, - Depth = 7, - Format = TextureFormat.R8G8B8A8, - IsCube = false, - LevelCount = 1, - UsageFlags = TextureUsageFlags.Sampler - }); + texture = Texture.CreateTexture3D(GraphicsDevice, 16, 16, 7, TextureFormat.R8G8B8A8, TextureUsageFlags.Sampler); CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer(); cmdbuf.SetBufferData( diff --git a/VertexSampler/VertexSamplerGame.cs b/VertexSampler/VertexSamplerGame.cs index 323586c..453ba27 100644 --- a/VertexSampler/VertexSamplerGame.cs +++ b/VertexSampler/VertexSamplerGame.cs @@ -29,16 +29,7 @@ namespace MoonWorks.Test // Create and populate the GPU resources vertexBuffer = Buffer.Create(GraphicsDevice, BufferUsageFlags.Vertex, 3); - texture = new Texture(GraphicsDevice, new TextureCreateInfo - { - Width = 3, - Height = 1, - Depth = 1, - Format = TextureFormat.R8G8B8A8, - IsCube = false, - LevelCount = 1, - UsageFlags = TextureUsageFlags.Sampler - }); + texture = Texture.CreateTexture2D(GraphicsDevice, 3, 1, TextureFormat.R8G8B8A8, TextureUsageFlags.Sampler); sampler = new Sampler(GraphicsDevice, SamplerCreateInfo.PointClamp); CommandBuffer cmdbuf = GraphicsDevice.AcquireCommandBuffer();