void drawFrame(struct Context *context, cairo_t *cr) { struct Atom *newcoords; if (context->config->erasePreviousFrame) { clearFrame(context, cr); } newcoords = rotateAtoms(context); drawAtoms(cr, context->currentFrame, newcoords, context->currentFrame->numAtoms, context->config); g_free(newcoords); }
void OpenGLWidget::paintGL() { // Clear color and depth buffer glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if (!m_molecule) return; m_program.setUniformValue(m_viewLocation, m_camera.viewMatrix()); m_program.setUniformValue(m_projectionLocation, m_camera.projectionMatrix()); m_program.setUniformValue(m_lightLocation, QVector3D(10, 10, 10)); drawAtoms(); drawBonds(); }