/******************************************************************************
*	File		-	index_buffer.h
*	Author		-	Joey Pollack
*	Date		-	2022/08/05 (y/m/d)
*	Mod Date	-	2022/08/05 (y/m/d)
*	Description	-	OpenGL index buffer object
******************************************************************************/

#ifndef LUNARIUM_INDEX_BUFFER_H_
#define LUNARIUM_INDEX_BUFFER_H_

#include <core/common_defs.h>
#include <utils/op_res.h>

namespace lunarium
{
    class IndexBuffer
    {
    public:

        IndexBuffer(u32 size, u32* indices = nullptr);
        //IndexBuffer(u32 size);

        bool IsStatic() const;
        void Clear();
        void Bind();

        /// Returns false if the data does not fit in the buffer
        /// size is the size in bytes
        bool PushIndices(const u32* indices, u32 size);
        u32 GetGLID() const;

    private:
        u32 mGLID;
        bool mIsStatic;
        u32 mSize;
        u32 mIndex;

    };
}

#endif	// LUNARIUM_INDEX_BUFFER_H_