light/modules/renderer/include/renderer/dx/texture.hpp

37 lines
675 B
C++
Raw Normal View History

2022-03-08 21:19:19 +03:30
#pragma once
#include <d3d11.h>
#include <renderer/texture.hpp>
2022-03-08 21:19:19 +03:30
#include <wrl.h>
namespace Light {
class dxSharedContext;
class dxTexture: public Texture
{
public:
2025-07-05 13:28:41 +03:30
dxTexture(
unsigned int width,
unsigned int height,
unsigned int components,
unsigned char *pixels,
Ref<dxSharedContext> sharedContext,
const std::string &filePath
);
2022-03-08 21:19:19 +03:30
void bind(unsigned int slot = 0u) override;
2025-07-05 16:07:51 +03:30
private:
Ref<dxSharedContext> m_context;
Microsoft::WRL::ComPtr<ID3D11Texture2D> m_texture_2d;
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_shader_resource_view;
Microsoft::WRL::ComPtr<ID3D11SamplerState> m_sampler_state;
2022-03-08 21:19:19 +03:30
};
2025-07-05 13:28:41 +03:30
} // namespace Light