| 267 | } |
| 268 | |
| 269 | void GLFWOSPRayWindow::mainLoop() |
| 270 | { |
| 271 | // continue until the user closes the window |
| 272 | startNewOSPRayFrame(); |
| 273 | |
| 274 | while (!glfwWindowShouldClose(glfwWindow) && !g_quitNextFrame) { |
| 275 | glfwPollEvents(); |
| 276 | |
| 277 | ImGui_ImplOpenGL3_NewFrame(); |
| 278 | ImGui_ImplGlfw_NewFrame(); |
| 279 | ImGui::NewFrame(); |
| 280 | |
| 281 | if (displayCallback) |
| 282 | displayCallback(this); |
| 283 | |
| 284 | display(); |
| 285 | |
| 286 | if (showUi) |
| 287 | buildUI(); |
| 288 | |
| 289 | glDisable(GL_FRAMEBUFFER_SRGB); // Disable SRGB conversion for UI |
| 290 | ImGui::Render(); |
| 291 | ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData()); |
| 292 | |
| 293 | glfwSwapBuffers(glfwWindow); |
| 294 | } |
| 295 | |
| 296 | waitOnOSPRayFrame(); |
| 297 | } |
| 298 | |
| 299 | void GLFWOSPRayWindow::reshape(const vec2i &newWindowSize) |
| 300 | { |