Ejemplo n.º 1
0
int RenderContext::render(void) {

  tm.Start();
  glm::uvec3 counters = glm::uvec3(0);
  ac.reset();
  glfwGetCursorPos(window, &pos_x, &pos_y);

  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  mb.render(iter, aspect_ratio, cx, cy, cur_scale);
  text.print(hud, 10, 50, screen_width, screen_height);

  counters = ac.read();

  tm.Stop();
  float time = tm.Report();
  glfwSwapBuffers(window);
  glfwPollEvents();

  float mod = glm::clamp(16000.0f / time, .1f, 2.0f);
  iter = glm::clamp(int(iter * mod), 10, 50000) ;
  // iter = 100;
  snprintf(hud, sizeof(hud), "%5.2fms, %5E, %5i,\n%5.3E, %6f, %6f \n",
           time/1000, double(counters[0]), iter, cur_scale, cx, cy);
  // printf("%s\n", hud);

  return 0;
}
Ejemplo n.º 2
0
 void reset() {
   success = 0;
   failure = 0;
   cnt.reset();
 }