mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-17 07:28:12 +08:00
Rename functions
This commit is contained in:
parent
0be2b379a2
commit
7761387403
@ -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() {
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user