#include <Item/StatelessItem/BasicItem/BasicItem.hpp>
#include <Model/Model.hpp>
#include <Display/WidgetDisplay/WorldDisplay/WorldDisplay.hpp>

BasicItem::BasicItem(std::string name, std::string displayName, Material &mat) :
    StatelessItem(name, displayName),
    m_material(mat)
{}

void BasicItem::draw(GraphicsContext &context, int x, int y, const ItemStack &stack)
{
    context.color = glm::vec4(1.0f);
    context.drawMaterial(m_material, x, y);
}

void BasicItem::draw3D(GraphicsContext &context, WorldDisplay &worldDisplay, glm::vec3 pos, ItemStack &stack)
{
    worldDisplay.drawMeshedIcon(context, m_material, pos);
}

void BasicItem::drawFlat(GraphicsContext &context, WorldDisplay &worldDisplay, glm::mat4 matrix, ItemStack &stack)
{
    worldDisplay.drawMeshedIconFlat(context, m_material, matrix);
}