1
0
mirror of https://github.com/borgesdan/xn65 synced 2024-12-29 21:54:47 +01:00
xn65/framework/platform/indexbuffer-dx.hpp

39 lines
913 B
C++
Raw Normal View History

2024-04-11 10:38:56 -03:00
#ifndef XNA_PLATFORM_INDEXBUFFER_DX_HPP
#define XNA_PLATFORM_INDEXBUFFER_DX_HPP
#include "../graphics/indexbuffer.hpp"
#include "dxheaders.hpp"
namespace xna {
class IndexBuffer : public IIndexBuffer {
public:
IndexBuffer() {
_description.Usage = D3D11_USAGE_DEFAULT;
2024-04-12 15:21:00 -03:00
_description.BindFlags = D3D11_BIND_INDEX_BUFFER;
2024-04-11 10:38:56 -03:00
}
IndexBuffer(size_t size) {
_description.ByteWidth = static_cast<UINT>(size);
_description.Usage = D3D11_USAGE_DEFAULT;
_description.BindFlags = D3D11_BIND_INDEX_BUFFER;
}
IndexBuffer(D3D11_BUFFER_DESC desc) : _description(desc){}
virtual ~IndexBuffer() override {
if (_buffer) {
_buffer->Release();
_buffer = nullptr;
}
}
virtual bool Initialize(GraphicsDevice& device, xna_error_nullarg) override;
public:
D3D11_BUFFER_DESC _description;
ID3D11Buffer* _buffer = nullptr;
2024-04-12 15:21:00 -03:00
D3D11_SUBRESOURCE_DATA _subResource{};
2024-04-11 10:38:56 -03:00
};
}
#endif