light/Engine/src/Platform/GraphicsAPI/DirectX/dxTexture.hpp

28 lines
660 B
C++
Raw Normal View History

2022-03-08 21:19:19 +03:30
#pragma once
#include "Base/Base.hpp"
#include "Graphics/Texture.hpp"
#include <d3d11.h>
#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:
dxTexture(unsigned int width, unsigned int height, unsigned int components, unsigned char* pixels, Ref<dxSharedContext> sharedContext, const std::string& filePath);
void Bind(unsigned int slot = 0u) override;
};
} // namespace Light