Skip to content

Commit

Permalink
Support for cube textures
Browse files Browse the repository at this point in the history
  • Loading branch information
deccer committed Nov 19, 2022
1 parent 298efa1 commit 200f86b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/EngineKit/Graphics/Texture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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");
}
}

Expand Down

0 comments on commit 200f86b

Please sign in to comment.