23 bool LoadCubemap(
const std::array<std::string, 6>& facePaths);
34 void Bind(uint32_t slot = 0)
const override;
40 uint32_t
GetWidth()
const override {
return m_width; }
41 uint32_t
GetHeight()
const override {
return m_height; }
47 bool CreateCubemapFromFaces(
const std::vector<unsigned char*>& faceData,
49 void CreateSamplerState();
51 Microsoft::WRL::ComPtr<ID3D11Device> m_device;
52 Microsoft::WRL::ComPtr<ID3D11DeviceContext> m_deviceContext;
53 Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture;
54 Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_shaderResourceView;
55 Microsoft::WRL::ComPtr<ID3D11SamplerState> m_samplerState;
58 uint32_t m_height = 0;
bool LoadEquirectangular(const std::string &path, uint32_t faceSize=512)
Loads a single equirectangular panorama and resamples it into 6 cube faces.
TextureFormat GetFormat() const override
uint32_t GetWidth() const override
bool LoadFromMemory(const void *data, uint32_t width, uint32_t height, TextureFormat format) override
Unused for cubemaps; load via LoadCubemap/LoadEquirectangular instead.
void Bind(uint32_t slot=0) const override
void SetFilter(TextureFilter filter) override
void Unbind() const override
TextureType GetType() const override
~DirectX11CubemapTexture() override
uint32_t GetHeight() const override
void SetWrapMode(TextureWrapMode wrapMode) override
DirectX11CubemapTexture(ID3D11Device *device)
bool LoadFromFile(const std::string &filePath) override
Unused for cubemaps; load via LoadCubemap/LoadEquirectangular instead.
bool LoadCubemap(const std::array< std::string, 6 > &facePaths)
Loads and uploads 6 face images: +X, -X, +Y, -Y, +Z, -Z.