Program Listing for File index_buffer.h¶
↰ Return to documentation for file (rootex/core/renderer/index_buffer.h
)
#pragma once
#include <d3d11.h>
#include "common/common.h"
class IndexBuffer
{
protected:
Microsoft::WRL::ComPtr<ID3D11Buffer> m_IndexBuffer;
unsigned int m_Count;
DXGI_FORMAT m_Format;
public:
IndexBuffer(const Vector<unsigned short>& indices, bool dynamicWrite = false);
IndexBuffer(const Vector<unsigned int>& indices);
IndexBuffer(const int* indices, size_t size);
~IndexBuffer() = default;
void bind() const;
unsigned int getCount() const;
ID3D11Buffer* getBuffer() { return m_IndexBuffer.Get(); }
};