2006-04-13 20:47:06 +00:00
|
|
|
// SDL interface layer
|
|
|
|
// for the Build Engine
|
2012-03-12 04:47:04 +00:00
|
|
|
// by Jonathon Fowler (jf@jonof.id.au)
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2014-11-22 12:32:56 +00:00
|
|
|
#ifndef build_interface_layer_
|
|
|
|
#define build_interface_layer_ SDL
|
2006-04-13 20:47:06 +00:00
|
|
|
|
|
|
|
#include "baselayer.h"
|
2018-11-18 18:13:02 +00:00
|
|
|
#include "compat.h"
|
2006-04-13 20:47:06 +00:00
|
|
|
|
2012-11-05 02:49:08 +00:00
|
|
|
|
2019-12-23 19:03:03 +00:00
|
|
|
inline void idle(int const msec = 1)
|
2012-11-05 02:49:08 +00:00
|
|
|
{
|
2019-10-19 23:43:30 +00:00
|
|
|
#ifdef _WIN32
|
2019-10-19 23:42:17 +00:00
|
|
|
Sleep(msec);
|
2019-10-19 23:43:30 +00:00
|
|
|
#else
|
|
|
|
timespec const req = { 0, msec * 1000000 };
|
|
|
|
do { } while (nanosleep(&req, &req));
|
2012-11-24 09:13:29 +00:00
|
|
|
#endif
|
2012-11-05 02:49:08 +00:00
|
|
|
}
|
|
|
|
|
2006-04-13 20:47:06 +00:00
|
|
|
#else
|
2014-11-22 12:32:56 +00:00
|
|
|
#if (build_interface_layer_ != SDL)
|
|
|
|
#error "Already using the " build_interface_layer_ ". Can't now use SDL."
|
2006-04-13 20:47:06 +00:00
|
|
|
#endif
|
2014-11-22 12:32:56 +00:00
|
|
|
#endif // build_interface_layer_
|
2006-04-13 20:47:06 +00:00
|
|
|
|