light/modules/engine/include/engine/platform/graphics/directx/texture.hpp

35 lines
707 B
C++
Raw Normal View History

2022-03-08 21:19:19 +03:30
#pragma once
#include <d3d11.h>
2025-07-05 13:28:41 +03:30
#include <engine/base/base.hpp>
#include <engine/graphics/texture.hpp>
2022-03-08 21:19:19 +03:30
#include <wrl.h>
namespace Light {
class dxSharedContext;
class dxTexture: public Texture
{
private:
Ref<dxSharedContext> m_Context;
Microsoft::WRL::ComPtr<ID3D11Texture2D> m_Texture2D;
Microsoft::WRL::ComPtr<ID3D11ShaderResourceView> m_ShaderResourceView;
Microsoft::WRL::ComPtr<ID3D11SamplerState> m_SamplerState;
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 13:28:41 +03:30
} // namespace Light