lol/src/Drawable.cpp

20 lines
313 B
C++
Raw Normal View History

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