[AD] proposal: al_sleep()

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


I mentioned it already about a week ago in the post about my ALSA
troubles, but nobody commented. Almost every (of my) Allegro programs
contains the following, in order to get <100% CPU (looks nicer to users,
drops CPU temp about 10°C, runs smoother..):

#ifdef ALLEGRO_LINUX
  struct timeval tv = {0, 1};
  select (0, NULL, NULL, NULL, &tv); 
#elif defined(ALLEGRO_WINDOWS)
  Sleep (1);
#else
  yield_timeslice ();
#endif

Once I find out how to do it in OSX, I could add another #define, and so
on.. but since Allegro already has yield_timeslice () - which is rather
useless in my opinion - shouldn't we provide an al_sleep(), with
al_sleep(0) deprecating yield_timeslice()?

-- 
Elias Pschernig <elias@xxxxxxxxxx>





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/