Adding a minor sleep period to not spend 100% cpu.
This commit is contained in:
@@ -161,8 +161,6 @@ class Main {
|
|||||||
GL.clear (GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT );
|
GL.clear (GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT );
|
||||||
GL.drawArrays (GL.TRIANGLES, 0, 6);
|
GL.drawArrays (GL.TRIANGLES, 0, 6);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -266,9 +266,9 @@ class LiME {
|
|||||||
|
|
||||||
do_render(_event);
|
do_render(_event);
|
||||||
|
|
||||||
if(render != null) {
|
//make sure the c++ knows our sleep time
|
||||||
render.next_wake();
|
render.next_wake();
|
||||||
}
|
|
||||||
} // if !has_shutdown
|
} // if !has_shutdown
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -225,7 +225,8 @@ class RenderHandler {
|
|||||||
if(lib.shutting_down) return;
|
if(lib.shutting_down) return;
|
||||||
|
|
||||||
#if lime_native
|
#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
|
#end //lime_native
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user