collision sphere previsualization
This commit is contained in:
@ -21,8 +21,6 @@ OpenGLMesh::OpenGLMesh(QVector<float> verts, QOpenGLTexture *tex, QOpenGLShaderP
|
||||
glf->glEnableVertexAttribArray(1);
|
||||
glf->glVertexAttribPointer(2, 2, GL_FLOAT, GL_FALSE, 8 * sizeof (float), (void *) (6 * sizeof (float)));
|
||||
glf->glEnableVertexAttribArray(2);
|
||||
tex->bind();
|
||||
glf->glBindVertexArray(0);
|
||||
OpenGLWidget::instance->doneCurrent();
|
||||
}
|
||||
|
||||
@ -31,7 +29,7 @@ void OpenGLMesh::draw(QOpenGLExtraFunctions *f, const QMatrix4x4 &mat) const {
|
||||
program->bind();
|
||||
program->setUniformValue("model", mat);
|
||||
f->glBindVertexArray(vao);
|
||||
tex->bind();
|
||||
if (tex) tex->bind();
|
||||
f->glDrawArrays(GL_TRIANGLES, 0, nverts);
|
||||
tex->release();
|
||||
if (tex) tex->release();
|
||||
}
|
||||
|
Reference in New Issue
Block a user