X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2Fmodel.cpp;fp=src%2Fmodel%2Fmodel.cpp;h=72de1dadfa304f9d0026e30411def46cc022a839;hb=7bb75960dbf9bfdee9ac865384aca81791b3da5c;hp=b834298ac6c5354dff984b55fa4bc3b8b245c839;hpb=a34fbcb0581056bd464158acfa30289a3e2c2c2d;p=blank.git diff --git a/src/model/model.cpp b/src/model/model.cpp index b834298..72de1da 100644 --- a/src/model/model.cpp +++ b/src/model/model.cpp @@ -11,6 +11,9 @@ namespace blank { void EntityModel::Update(const Buffer &buf) noexcept { #ifndef NDEBUG + if (buf.tex_coords.size() < buf.vertices.size()) { + std::cerr << "EntityModel: not enough tex coords!" << std::endl; + } if (buf.colors.size() < buf.vertices.size()) { std::cerr << "EntityModel: not enough colors!" << std::endl; } @@ -21,6 +24,7 @@ void EntityModel::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); + vao.PushAttribute(ATTRIB_TEXCOORD, buf.tex_coords); vao.PushAttribute(ATTRIB_COLOR, buf.colors); vao.PushAttribute(ATTRIB_NORMAL, buf.normals); vao.PushIndices(ATTRIB_INDEX, buf.indices); @@ -34,6 +38,9 @@ void EntityModel::Draw() const noexcept { void BlockModel::Update(const Buffer &buf) noexcept { #ifndef NDEBUG + if (buf.tex_coords.size() < buf.vertices.size()) { + std::cerr << "BlockModel: not enough tex coords!" << std::endl; + } if (buf.colors.size() < buf.vertices.size()) { std::cerr << "BlockModel: not enough colors!" << std::endl; } @@ -44,6 +51,7 @@ void BlockModel::Update(const Buffer &buf) noexcept { vao.Bind(); vao.PushAttribute(ATTRIB_VERTEX, buf.vertices); + vao.PushAttribute(ATTRIB_TEXCOORD, buf.tex_coords); vao.PushAttribute(ATTRIB_COLOR, buf.colors); vao.PushAttribute(ATTRIB_LIGHT, buf.lights); vao.PushIndices(ATTRIB_INDEX, buf.indices);