
#include "CIndexBuffer.h"

#include <glad/glad.h>


namespace ion
{
	namespace Graphics
	{
		namespace GL
		{

			void CIndexBuffer::UploadData(void const * Data, size_t const Elements, EValueType const ValueType)
			{
				CheckedGLCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, Handle));
				CheckedGLCall(glBufferData(GL_ELEMENT_ARRAY_BUFFER, Elements * GetValueTypeSize(ValueType), Data, GL_STATIC_DRAW));
				CheckedGLCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
			}

		}
	}
}


#include "CIndexBuffer.h"

#include <glad/glad.h>


namespace ion
{
	namespace Graphics
	{
		namespace GL
		{

			void CIndexBuffer::UploadData(void const * Data, size_t const Elements, EValueType const ValueType)
			{
				CheckedGLCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, Handle));
				CheckedGLCall(glBufferData(GL_ELEMENT_ARRAY_BUFFER, Elements * GetValueTypeSize(ValueType), Data, GL_STATIC_DRAW));
				CheckedGLCall(glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0));
				Size = Elements;
			}

		}
	}
}

Fix bug where uninitialized index buffers still wouldn't work after initialization
Fix bug where uninitialized index buffers still wouldn't work after initialization
