// This function is called by Qt any time your GL window is supposed to update // For example, when the function updateGL is called, paintGL is called implicitly. void MyGL::paintGL() { // Clear the screen so that we only see newly drawn images glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Update the viewproj matrix prog_lambert.setViewProjMatrix(gl_camera.getViewProj()); prog_flat.setViewProjMatrix(gl_camera.getViewProj()); GLDrawScene(); }
void CQOpenGL::paintGL() { if (Drawing) return; Drawing = true; makeCurrent(); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); if (!IniViewSet) GLCenterView(); //set the view appropriately the first time through GLDrawScene(); // Draw OpenGL scene //output frames for video bool AutoSaveFrame = false; emit WantAutoSaveFrames(&AutoSaveFrame); if (AutoSaveFrame){ QString SavePath = ""; emit GetFrameFilePath(&SavePath); if (SavePath != "") GlSaveScreenShot(SavePath); } Drawing = false; }