mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-16 09:21:12 +00:00
be899ba3af
This needs improvements to bring it up to par with winlayer, but it is functional. In particular, a good amount of code from winlayer could be used for both layers, including the profiling timers, the version printing code, and the hInstance and hModule sharing. Known problems: the mouse cursor is not trapped, and the game starts before the startup window shows options. git-svn-id: https://svn.eduke32.com/eduke32@3219 1a8010ca-5511-0410-912e-c29ae57300e0
50 lines
936 B
C
50 lines
936 B
C
// 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
|
|
int32_t win_gethinstance(void);
|
|
#endif
|
|
|
|
struct sdlappicon {
|
|
int32_t width,height;
|
|
uint32_t *pixels;
|
|
uint8_t *mask;
|
|
};
|
|
|
|
#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__
|
|
|