lol/src/Drawable.cpp

20 lines
313 B
C++
Raw Normal View History

2021-12-22 23:45:24 +00:00
#include <lol/Drawable.hpp>
2021-12-22 23:25:50 +00:00
2021-12-22 23:51:59 +00:00
namespace lol
2021-12-22 23:25:50 +00:00
{
2021-12-22 23:51:59 +00:00
void Drawable::Draw(const CameraBase& camera) const
{
2021-12-24 13:20:53 +00:00
shader->Bind();
vao->Bind();
2021-12-22 23:51:59 +00:00
PreRender(camera);
2021-12-24 13:20:53 +00:00
glDrawElements(NATIVE(type), vao->GetIndexCount(), GL_UNSIGNED_INT, nullptr);
2021-12-22 23:51:59 +00:00
}
2021-12-24 13:20:53 +00:00
void Drawable::SetDrawMode(DrawMode type)
2021-12-22 23:51:59 +00:00
{
this->type = type;
}
}