raze/polymer/eduke32/build/include/sdlayer.h
hendricks266 fcf9beae6a Work-in-progress adjustment to the C code to compile under C++. It builds for me without errors using Win32 MinGW-GCC, but it still generates warning soup. No guarantees about MSVC or anything using SDL. Enable C++ by building with CPLUSPLUS=1. C remains the default and should compile with no change in setup.
Credit to Plagman for the idea and doing the work on the game side, which is included in this commit.

(Building as C++ will give us features with which we can make improvements and optimizations on the multiplayer code and Polymer.)

git-svn-id: https://svn.eduke32.com/eduke32@3116 1a8010ca-5511-0410-912e-c29ae57300e0
2012-11-05 02:49:08 +00:00

38 lines
702 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"
struct sdlappicon {
int32_t width,height;
uint32_t *pixels;
uint8_t *mask;
};
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)
{
usleep(1000);
}
#else
#if (__build_interface_layer__ != SDL)
#error "Already using the " __build_interface_layer__ ". Can't now use SDL."
#endif
#endif // __build_interface_layer__