From 200f86bbf2813b57197911a68a3f073027e0d748 Mon Sep 17 00:00:00 2001 From: deccer Date: Sun, 20 Nov 2022 00:00:24 +0100 Subject: [PATCH] Support for cube textures --- src/EngineKit/Graphics/Texture.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/EngineKit/Graphics/Texture.cs b/src/EngineKit/Graphics/Texture.cs index 34d4449..1dd4f16 100644 --- a/src/EngineKit/Graphics/Texture.cs +++ b/src/EngineKit/Graphics/Texture.cs @@ -49,6 +49,14 @@ internal Texture(TextureCreateDescriptor textureCreateDescriptor) textureCreateDescriptor.Size.X, textureCreateDescriptor.Size.Y); break; + case ImageType.TextureCube: + GL.TextureStorage2D( + _id, + textureCreateDescriptor.MipLevels, + textureCreateDescriptor.Format.ToGL(), + textureCreateDescriptor.Size.X, + textureCreateDescriptor.Size.Y); + break; case ImageType.Texture3D: GL.TextureStorage3D( _id, @@ -67,6 +75,9 @@ internal Texture(TextureCreateDescriptor textureCreateDescriptor) textureCreateDescriptor.Size.Y, (int)textureCreateDescriptor.ArrayLayers); break; + default: + throw new NotImplementedException( + $"ImageType {textureCreateDescriptor.ImageType} is not implemented yet"); } }