Browse Source

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

naelstrof 7 years ago
parent
commit
9b43427abc
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/slop.cpp

+ 2
- 0
src/slop.cpp View File

@@ -244,6 +244,8 @@ slop::SlopSelection slop::GLSlopSelect( slop::SlopOptions* options, bool* cancel
244 244
         }
245 245
 
246 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 249
         GLenum err = glGetError();
248 250
         if ( err != GL_NO_ERROR ) {
249 251
             std::string error;