Adding a minor sleep period to not spend 100% cpu.

This commit is contained in:
underscorediscovery
2013-07-17 21:36:47 -02:30
parent 83b9bd60a9
commit 46a9fac71c
3 changed files with 5 additions and 6 deletions

View File

@@ -161,8 +161,6 @@ class Main {
GL.clear (GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT );
GL.drawArrays (GL.TRIANGLES, 0, 6);
}

View File

@@ -266,9 +266,9 @@ class LiME {
do_render(_event);
if(render != null) {
render.next_wake();
}
//make sure the c++ knows our sleep time
render.next_wake();
} // if !has_shutdown
return true;

View File

@@ -225,7 +225,8 @@ class RenderHandler {
if(lib.shutting_down) return;
#if lime_native
// nme_stage_set_next_wake( direct_renderer_handle, 0.2 );
//todo - sleep a tiny amount to not use 100% cpu
nme_stage_set_next_wake( lib.view_handle , 0.001 );
#end //lime_native
}