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;
|
|
|
|
|
2021-06-13 19:35:48 +04:30
|
|
|
D3D11_MAPPED_SUBRESOURCE m_Map;
|
|
|
|
|
2021-06-02 17:20:15 +04:30
|
|
|
unsigned int m_Stride;
|
|
|
|
public:
|
2021-06-14 17:02:56 +04:30
|
|
|
dxVertexBuffer(float* vertices, unsigned int stride, unsigned int count, void* sharedContext);
|
2021-06-02 17:20:15 +04:30
|
|
|
~dxVertexBuffer();
|
|
|
|
|
2021-06-13 19:35:48 +04:30
|
|
|
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:
|
2021-06-14 17:02:56 +04:30
|
|
|
dxIndexBuffer(unsigned int* indices, unsigned int count, void* sharedContext);
|
2021-06-13 19:35:48 +04:30
|
|
|
~dxIndexBuffer();
|
|
|
|
|
2021-06-02 17:20:15 +04:30
|
|
|
void Bind() override;
|
|
|
|
void UnBind() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|