2022-03-08 21:19:19 +03:30
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <d3d11.h>
|
2025-07-10 13:29:03 +03:30
|
|
|
#include <renderer/vertex_layout.hpp>
|
2022-03-08 21:19:19 +03:30
|
|
|
#include <wrl.h>
|
|
|
|
|
2025-07-11 00:05:48 +03:30
|
|
|
namespace lt {
|
2022-03-08 21:19:19 +03:30
|
|
|
|
|
|
|
class Shader;
|
|
|
|
class dxSharedContext;
|
|
|
|
|
|
|
|
class dxVertexLayout: public VertexLayout
|
|
|
|
{
|
|
|
|
public:
|
2025-07-05 13:28:41 +03:30
|
|
|
dxVertexLayout(
|
|
|
|
Ref<Shader> shader,
|
|
|
|
const std::vector<std::pair<std::string, VertexElementType>> &elements,
|
|
|
|
Ref<dxSharedContext> sharedContext
|
|
|
|
);
|
2025-07-05 16:07:51 +03:30
|
|
|
|
2022-03-08 21:19:19 +03:30
|
|
|
~dxVertexLayout();
|
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
void bind() override;
|
2025-07-05 16:07:51 +03:30
|
|
|
|
2025-07-05 15:36:53 +03:30
|
|
|
void un_bind() override;
|
2022-03-08 21:19:19 +03:30
|
|
|
|
|
|
|
private:
|
2025-07-05 15:36:53 +03:30
|
|
|
DXGI_FORMAT get_dxgi_format(VertexElementType type);
|
2025-07-05 16:07:51 +03:30
|
|
|
|
|
|
|
Ref<dxSharedContext> m_context;
|
|
|
|
|
|
|
|
Microsoft::WRL::ComPtr<ID3D11InputLayout> m_input_layout;
|
2022-03-08 21:19:19 +03:30
|
|
|
};
|
|
|
|
|
2025-07-11 00:05:48 +03:30
|
|
|
} // namespace lt
|