// SDL interface layer // for the Build Engine // by Jonathon Fowler (jf@jonof.id.au) #ifndef build_interface_layer_ #define build_interface_layer_ SDL #include "sdl_inc.h" #include "compat.h" #include "baselayer.h" #ifdef _WIN32 HWND win_gethwnd(void); HINSTANCE win_gethinstance(void); #endif #include "sdlappicon.h" #if (SDL_MAJOR_VERSION == 1 && SDL_MINOR_VERSION < 3) // SDL 1.2 int32_t SDL_WaitEventTimeout(SDL_Event *event, int32_t timeout); #endif static inline void idle_waitevent_timeout(uint32_t timeout) { SDL_WaitEventTimeout(NULL, timeout); } static inline void idle_waitevent(void) { SDL_WaitEvent(NULL); } static inline void idle(void) { #ifndef _WIN32 usleep(1000); #else Sleep(1); #endif } #else #if (build_interface_layer_ != SDL) #error "Already using the " build_interface_layer_ ". Can't now use SDL." #endif #endif // build_interface_layer_