瀏覽代碼

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

naelstrof 7 年之前
父節點
當前提交
9b43427abc
共有 1 個檔案被更改,包括 2 行新增0 行删除
  1. 2
    0
      src/slop.cpp

+ 2
- 0
src/slop.cpp 查看文件

@@ -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;