Selaa lähdekoodia

introduced a sleep for opengl mode to prevent 100% cpu usage

naelstrof 7 vuotta sitten
vanhempi
commit
9b43427abc
1 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. 2
    0
      src/slop.cpp

+ 2
- 0
src/slop.cpp Näytä tiedosto

244
         }
244
         }
245
 
245
 
246
         window->display();
246
         window->display();
247
+        // Here we sleep just to prevent our CPU usage from going to 100%.
248
+        std::this_thread::sleep_for(std::chrono::milliseconds(10));
247
         GLenum err = glGetError();
249
         GLenum err = glGetError();
248
         if ( err != GL_NO_ERROR ) {
250
         if ( err != GL_NO_ERROR ) {
249
             std::string error;
251
             std::string error;