void RenderState::setVertexAttribPointer(const VertexElement& e, size_t baseIndex, bool force) { #if !defined(ET_CONSOLE_APPLICATION) (void)force; if (e.dataType() == DataType::Int) { glVertexAttribIPointer(GLuint(e.usage()), static_cast<GLint>(e.components()), dataTypeValue(e.dataType()), e.stride(), reinterpret_cast<GLvoid*>(e.offset() + baseIndex)); } else if (e.dataType() == DataType::Float) { glVertexAttribPointer(GLuint(e.usage()), static_cast<GLint>(e.components()), dataTypeValue(e.dataType()), false, e.stride(), reinterpret_cast<GLvoid*>(e.offset() + baseIndex)); } else { ET_FAIL("Unhandled vertex attribute data type."); } checkOpenGLError("glVertexAttribPointer"); #endif }
bool VertexElement::operator != (const VertexElement &src) const { if (_usageIndex != src.usageIndex()) return true; if (_usage != src.usage()) return true; if (_method != src.method()) return true; if (_type != src.type()) return true; if (_offset != src.offset()) return true; if (_stream != src.stream()) return true; return false; }