Added OpenAL support to Linux

This commit is contained in:
Robert Beckebans 2013-01-04 13:24:52 +01:00
parent c47e78d6f3
commit 33774e2225
2 changed files with 28 additions and 10 deletions

View file

@ -1170,8 +1170,7 @@ if(MSVC)
else()
list(APPEND RBDOOM3_SOURCES
${SYS_INCLUDES} ${SYS_SOURCES}
${STUBAUDIO_INCLUDES} ${STUBAUDIO_SOURCES})
${SYS_INCLUDES} ${SYS_SOURCES})
if(WIN32)
add_definitions(-DUSE_DOOMCLASSIC)
@ -1201,11 +1200,31 @@ else()
${POSIX_INCLUDES} ${POSIX_SOURCES}
${SDL_INCLUDES} ${SDL_SOURCES}
sys/linux/linux_main.cpp)
if(OPENAL)
find_package(OpenAL REQUIRED)
add_definitions(-DUSE_OPENAL)
#include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/openal-soft/include)
#if(CMAKE_CL_64)
# link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/openal-soft/lib/win64)
#else()
# link_directories(${CMAKE_CURRENT_SOURCE_DIR}/libs/openal-soft/lib/win32)
#endif()
list(APPEND RBDOOM3_INCLUDES ${OPENAL_INCLUDES})
list(APPEND RBDOOM3_SOURCES ${OPENAL_SOURCES})
else()
list(APPEND RBDOOM3_INCLUDES ${STUBAUDIO_INCLUDES})
list(APPEND RBDOOM3_SOURCES ${STUBAUDIO_SOURCES})
endif()
endif()
list(REMOVE_DUPLICATES RBDOOM3_SOURCES)
add_executable(RBDoom3BFG WIN32 ${RBDOOM3_SOURCES})
add_executable(RBDoom3BFG WIN32 ${RBDOOM3_INCLUDES} ${RBDOOM3_SOURCES})
add_dependencies(RBDoom3BFG idlib)
@ -1242,6 +1261,7 @@ else()
dl
rt
${SDLx_LIBRARY}
${OPENAL_LIBRARY}
)
endif()

View file

@ -93,10 +93,6 @@ typedef enum
#include "SoundVoice.h"
#ifdef _MSC_VER // DG: stub out xaudio for MinGW etc
#define OPERATION_SET 1
#if defined(USE_OPENAL)
#include <AL/al.h>
@ -106,7 +102,10 @@ typedef enum
#include "OpenAL/AL_SoundSample.h"
#include "OpenAL/AL_SoundVoice.h"
#include "OpenAL/AL_SoundHardware.h"
#else
#elif defined(_MSC_VER) // DG: stub out xaudio for MinGW etc
#define OPERATION_SET 1
// RB: not available on Windows 8 SDK
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/)
@ -122,12 +121,11 @@ typedef enum
#if (_WIN32_WINNT < 0x0602 /*_WIN32_WINNT_WIN8*/)
#include <xma2defs.h>
#endif
// RB end
#include "XAudio2/XA2_SoundSample.h"
#include "XAudio2/XA2_SoundVoice.h"
#include "XAudio2/XA2_SoundHardware.h"
#endif
// RB end
#else // not _MSC_VER => MinGW, GCC, ...
// just a stub for now