light/Engine/src/Platform/GraphicsAPI/DirectX/dxBuffers.h
Light 55869f6106 Ref, Scope
- Changed all std::unique_ptr/shared_ptr stuff to use Ref/Scope
- Fixed the Logger.h include in Base.h problem
2021-07-26 11:43:37 +04:30

71 lines
No EOL
1.3 KiB
C++

#pragma once
#include "Base.h"
#include "Graphics/Buffers.h"
#include <d3d11.h>
#include <wrl.h>
namespace Light {
class dxSharedContext;
//* INDEX_BUFFER *//
class dxConstantBuffer : public ConstantBuffer
{
private:
Ref<dxSharedContext> m_Context;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_Buffer;
D3D11_MAPPED_SUBRESOURCE m_Map;
unsigned int m_Index;
public:
dxConstantBuffer(ConstantBufferIndex index, unsigned int size, Ref<dxSharedContext> sharedContext);
void Bind() override;
void* Map() override;
void UnMap() override;
};
//* VERTEX_BUFFER *//
class dxVertexBuffer : public VertexBuffer
{
private:
Ref<dxSharedContext> m_Context;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_Buffer;
D3D11_MAPPED_SUBRESOURCE m_Map;
unsigned int m_Stride;
public:
dxVertexBuffer(float* vertices, unsigned int stride, unsigned int count, Ref<dxSharedContext> sharedContext);
~dxVertexBuffer();
void* Map() override;
void UnMap() override;
void Bind() override;
void UnBind() override;
};
//* INDEX_BUFFER *//
class dxIndexBuffer : public IndexBuffer
{
private:
Ref<dxSharedContext> m_Context;
Microsoft::WRL::ComPtr<ID3D11Buffer> m_Buffer;
public:
dxIndexBuffer(unsigned int* indices, unsigned int count, Ref<dxSharedContext> sharedContext);
~dxIndexBuffer();
void Bind() override;
void UnBind() override;
};
}