Aether3D Game Engine
Texture2D.hpp
1 #ifndef TEXTURE_2D_H
2 #define TEXTURE_2D_H
3 
4 #include "TextureBase.hpp"
5 #if RENDERER_VULKAN
6 #include <vulkan/vulkan.h>
7 #endif
8 
9 namespace ae3d
10 {
11  namespace FileSystem
12  {
13  struct FileContentsData;
14  }
15 
17  class Texture2D : public TextureBase
18  {
19  public:
21  static Texture2D* GetDefaultTexture();
22 
29  void Load( const FileSystem::FileContentsData& textureData, TextureWrap wrap, TextureFilter filter, Mipmaps mipmaps, ColorSpace colorSpace, float anisotropy );
30 
38  void LoadFromAtlas( const FileSystem::FileContentsData& atlasTextureData, const FileSystem::FileContentsData& atlasMetaData, const char* textureName, TextureWrap wrap, TextureFilter filter, ColorSpace colorSpace, float anisotropy );
39 
40 #if RENDERER_VULKAN
41  VkImageView& GetView() { return view; }
42 #endif
43 #if RENDERER_D3D12
44  static void DestroyTextures();
45 #endif
46 
47  private:
49  void LoadDDS( const char* path );
50 
56  void LoadSTB( const FileSystem::FileContentsData& textureData );
57 #if RENDERER_METAL
58  void LoadPVRv2( const char* path );
59  void LoadPVRv3( const char* path );
60 #endif
61 #if RENDERER_VULKAN
62  VkImage image = VK_NULL_HANDLE;
63  VkImageView view = VK_NULL_HANDLE;
64  VkDeviceMemory deviceMemory = VK_NULL_HANDLE;
65 #endif
66  };
67 }
68 #endif
Definition: AudioClip.hpp:4
2D texture.
Definition: Texture2D.hpp:17
Definition: FileSystem.hpp:12
Base class for textures.
Definition: TextureBase.hpp:54