Switch to automatic SDL 2.0.4 detection

This commit is contained in:
Dmitry Marakasov 2016-04-14 20:53:29 +03:00
parent 6532490388
commit 56d1890fff
4 changed files with 3 additions and 4 deletions

View File

@ -13,7 +13,6 @@ SET(SDL2PP_VERSION "${SDL2PP_MAJOR_VERSION}.${SDL2PP_MINOR_VERSION}.${SDL2PP_PAT
# there are functions present on wiki, but not yet in stable SDL2 releases;
# we hide these under following options
OPTION(SDL2PP_WITH_2_0_4 "Enable new functions available only in SDL2 2.0.4+" OFF)
OPTION(SDL2PP_WITH_WERROR "Make warnings fatal" OFF)
SET(SDL2PP_CXXSTD "c++11" CACHE STRING "Used c++ standard")

View File

@ -110,7 +110,7 @@ AudioDevice::LockHandle AudioDevice::Lock() {
return LockHandle(this);
}
#ifdef SDL2PP_WITH_2_0_4
#if SDL_VERSION_ATLEAST(2, 0, 4)
AudioDevice& AudioDevice::QueueAudio(const void* data, Uint32 len) {
if (SDL_QueueAudio(device_id_, data, len) != 0)
throw Exception("SDL_QueueAudio");

View File

@ -26,6 +26,7 @@
#include <string>
#include <SDL2/SDL_audio.h>
#include <SDL2/SDL_version.h>
#include <SDL2pp/Optional.hh>
#include <SDL2pp/Config.hh>
@ -304,7 +305,7 @@ public:
////////////////////////////////////////////////////////////
LockHandle Lock();
#ifdef SDL2PP_WITH_2_0_4
#if SDL_VERSION_ATLEAST(2, 0, 4)
////////////////////////////////////////////////////////////
/// \brief Queue more audio for a non-callback device
///

View File

@ -31,7 +31,6 @@
#cmakedefine SDL2PP_WITH_IMAGE
#cmakedefine SDL2PP_WITH_TTF
#cmakedefine SDL2PP_WITH_MIXER
#cmakedefine SDL2PP_WITH_2_0_4
#cmakedefine SDL2PP_WITH_EXPERIMENTAL_OPTIONAL
#cmakedefine SDL2PP_WITH_DEPRECATED