void VertexBufferInfo::setAttributePointers(const size_t bufferByteOffset) const { loopAttributesWithOffset([&](const VertexAttributeInfo info, const size_t byteOffset) { glVertexAttribPointer( info.getIndex(), info.getSize(), info.getType(), GL_FALSE, getByteStride(), reinterpret_cast< void* >(static_cast< size_t >(byteOffset) + bufferByteOffset) ); }); }
void VertexGenerator::Mesh2D::dumpInfo() { LOG_INFO("<-Dumpping Mesh2D information->\n"); LOG_INFO("Vertex Point Count: %d, Vertex Size: %d, TexCoords Size: %d, Byte Stride: %d\n", getVertexCount(), getVertexSize(), getTexCoordsSize(), getByteStride()); for(size_t i = 0; i < getVertexCount(); ++i) { float* position = getPositions() + getStride() * i; LOG_INFO("VertexPosition[%d]: %f, %f\n", i, *position, *(position + 1)); } for(size_t i = 0; i < getVertexCount(); ++i) { float* texCoords = getTexCoords() + getStride() * i; LOG_INFO("TexCoords[%d]: %f, %f\n", i, *texCoords, *(texCoords + 1)); } }