/* Global Headers */ #if defined(PLATFORM_XORG) #include #include #include #elif defined(PLATFORM_MACOSX) #define decimal CocoaDecimal #include #include #undef decimal #elif defined(PLATFORM_WINDOWS) #include #endif using namespace nall; /* Video */ #define DeclareVideo(Name) \ struct Video##Name : Video { \ Video##Name() : p(*new pVideo##Name) {} \ ~Video##Name() { delete &p; } \ \ auto cap(const string& name) -> bool { return p.cap(name); } \ auto get(const string& name) -> any { return p.get(name); } \ auto set(const string& name, const any& value) -> bool { return p.set(name, value); } \ \ auto lock(uint32_t*& data, unsigned& pitch, unsigned width, unsigned height) -> bool { return p.lock(data, pitch, width, height); } \ auto unlock() -> void { p.unlock(); } \ auto clear() -> void { p.clear(); } \ auto refresh() -> void { p.refresh(); } \ \ auto init() -> bool { return p.init(); } \ auto term() -> void { p.term(); } \ \ private: \ pVideo##Name& p; \ }; #ifdef VIDEO_CGL #include #endif #ifdef VIDEO_DIRECT3D #include #endif #ifdef VIDEO_DIRECTDRAW #include #endif #ifdef VIDEO_GDI #include #endif #ifdef VIDEO_GLX #include #endif #ifdef VIDEO_SDL #include #endif #ifdef VIDEO_WGL #include #endif #ifdef VIDEO_XSHM #include #endif #ifdef VIDEO_XV #include #endif /* Audio */ #define DeclareAudio(Name) \ struct Audio##Name : Audio { \ Audio##Name() : p(*new pAudio##Name) {} \ ~Audio##Name() { delete &p; } \ \ auto cap(const string& name) -> bool { return p.cap(name); } \ auto get(const string& name) -> any { return p.get(name); } \ auto set(const string& name, const any& value) -> bool { return p.set(name, value); } \ \ auto sample(uint16_t left, uint16_t right) -> void { p.sample(left, right); } \ auto clear() -> void { p.clear(); } \ \ auto init() -> bool { return p.init(); } \ auto term() -> void { p.term(); } \ \ private: \ pAudio##Name& p; \ }; #ifdef AUDIO_ALSA #include #endif #ifdef AUDIO_AO #include #endif #ifdef AUDIO_DIRECTSOUND #include #endif #ifdef AUDIO_OPENAL #include #endif #ifdef AUDIO_OSS #include #endif #ifdef AUDIO_PULSEAUDIO #include #endif #ifdef AUDIO_PULSEAUDIOSIMPLE #include #endif #ifdef AUDIO_XAUDIO2 #include #endif /* Input */ #define DeclareInput(Name) \ struct Input##Name : Input { \ Input##Name() : p(*new pInput##Name) {} \ ~Input##Name() { delete &p; } \ \ auto cap(const string& name) -> bool { return p.cap(name); } \ auto get(const string& name) -> any { return p.get(name); } \ auto set(const string& name, const any& value) -> bool { return p.set(name, value); } \ \ auto acquire() -> bool { return p.acquire(); } \ auto unacquire() -> bool { return p.unacquire(); } \ auto acquired() -> bool { return p.acquired(); } \ auto poll() -> vector> { return p.poll(); } \ auto rumble(uint64_t id, bool enable) -> bool { return p.rumble(id, enable); } \ \ auto init() -> bool { return p.init(); } \ auto term() -> void { p.term(); } \ \ private: \ pInput##Name& p; \ }; #ifdef INPUT_CARBON #include #endif #ifdef INPUT_SDL #include #endif #ifdef INPUT_UDEV #include #endif #ifdef INPUT_WINDOWS #include #endif #ifdef INPUT_XLIB #include #endif