light/Engine/src/Platform/GraphicsAPI/DirectX/dxVertexLayout.h

32 lines
649 B
C
Raw Normal View History

2021-06-02 17:20:15 +04:30
#pragma once
#include "Base.h"
#include "Graphics/VertexLayout.h"
#include <d3d11.h>
#include <wrl.h>
namespace Light {
class Shader;
class dxSharedContext;
2021-06-02 17:20:15 +04:30
class dxVertexLayout : public VertexLayout
{
private:
std::shared_ptr<dxSharedContext> m_Context;
2021-06-02 17:20:15 +04:30
Microsoft::WRL::ComPtr<ID3D11InputLayout> m_InputLayout;
2021-06-02 17:20:15 +04:30
public:
dxVertexLayout(std::shared_ptr<Shader> shader, const std::vector<std::pair<std::string, VertexElementType>>& elements, std::shared_ptr<dxSharedContext> sharedContext);
2021-06-02 17:20:15 +04:30
~dxVertexLayout();
void Bind() override;
void UnBind() override;
private:
DXGI_FORMAT GetDxgiFormat(VertexElementType type);
};
}