Rename functions

This commit is contained in:
Linloir 2022-12-12 22:51:59 +08:00
parent 0be2b379a2
commit 7761387403
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
2 changed files with 6 additions and 6 deletions

View File

@ -37,9 +37,9 @@ void Mesh::render(const ShaderProgram& shader) const {
} }
OPENGL_EXTRA_FUNCTIONS->glActiveTexture(GL_TEXTURE0); OPENGL_EXTRA_FUNCTIONS->glActiveTexture(GL_TEXTURE0);
_vao.setActive(); _vao.bind();
OPENGL_EXTRA_FUNCTIONS->glDrawElements(GL_TRIANGLES, _indices.size(), GL_UNSIGNED_INT, 0); OPENGL_EXTRA_FUNCTIONS->glDrawElements(GL_TRIANGLES, _indices.size(), GL_UNSIGNED_INT, 0);
_vao.setInactive(); _vao.unbind();
} }
void Mesh::setupMesh() { void Mesh::setupMesh() {

View File

@ -22,8 +22,8 @@ public:
inline unsigned int id() const { return _id; } inline unsigned int id() const { return _id; }
inline void setActive() const; inline void bind() const;
inline void setInactive() const; inline void unbind() const;
inline void bindVertexBufferObject(const VertexBufferObject& vbo); inline void bindVertexBufferObject(const VertexBufferObject& vbo);
inline void bindVertexBufferObject(VertexBufferObject&& vbo); inline void bindVertexBufferObject(VertexBufferObject&& vbo);
@ -35,7 +35,7 @@ public:
inline void disableVertexAttribute(unsigned int index) const; inline void disableVertexAttribute(unsigned int index) const;
}; };
inline void VertexArrayObject::setActive() const { inline void VertexArrayObject::bind() const {
// Check is id is valid // Check is id is valid
if (_id == -1) { if (_id == -1) {
Logger::error("Binding an invalid VertexArrayObject"); Logger::error("Binding an invalid VertexArrayObject");
@ -44,7 +44,7 @@ inline void VertexArrayObject::setActive() const {
OPENGL_EXTRA_FUNCTIONS->glBindVertexArray(_id); OPENGL_EXTRA_FUNCTIONS->glBindVertexArray(_id);
} }
inline void VertexArrayObject::setInactive() const { inline void VertexArrayObject::unbind() const {
OPENGL_EXTRA_FUNCTIONS->glBindVertexArray(0); OPENGL_EXTRA_FUNCTIONS->glBindVertexArray(0);
} }