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

49 lines
1 KiB
C
Raw Normal View History

2021-06-02 17:20:15 +04:30
#pragma once
#include "Base.h"
#include "dxBase.h"
#include "Graphics/Buffers.h"
#include <d3d11.h>
#include <wrl.h>
namespace Light {
class dxVertexBuffer : public VertexBuffer
{
private:
Microsoft::WRL::ComPtr<ID3D11Buffer> m_Buffer;
Microsoft::WRL::ComPtr<ID3D11Device> m_Device;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> m_DeviceContext;
D3D11_MAPPED_SUBRESOURCE m_Map;
2021-06-02 17:20:15 +04:30
unsigned int m_Stride;
public:
dxVertexBuffer(float* vertices, unsigned int stride, unsigned int count, void* sharedContext);
2021-06-02 17:20:15 +04:30
~dxVertexBuffer();
void* Map() override;
void UnMap() override;
void Bind() override;
void UnBind() override;
};
class dxIndexBuffer : public IndexBuffer
{
private:
Microsoft::WRL::ComPtr<ID3D11Buffer> m_Buffer;
Microsoft::WRL::ComPtr<ID3D11Device> m_Device;
Microsoft::WRL::ComPtr<ID3D11DeviceContext> m_DeviceContext;
public:
dxIndexBuffer(unsigned int* indices, unsigned int count, void* sharedContext);
~dxIndexBuffer();
2021-06-02 17:20:15 +04:30
void Bind() override;
void UnBind() override;
};
}