Uploading new structure of cAudio using wolfmanfx's cmake system
This commit is contained in:
parent
6dde5fd37e
commit
68df33ca10
1
CMake/CMakeDependentOption.cmake
Normal file
1
CMake/CMakeDependentOption.cmake
Normal file
@ -0,0 +1 @@
|
||||
# - Macro to provide an option dependent on other options.
# This macro presents an option to the user only if a set of other
# conditions are true. When the option is not presented a default
# value is used, but any value set by the user is preserved for when
# the option is presented again.
# Example invocation:
# CMAKE_DEPENDENT_OPTION(USE_FOO "Use Foo" ON
# "USE_BAR;NOT USE_ZOT" OFF)
# If USE_BAR is true and USE_ZOT is false, this provides an option called
# USE_FOO that defaults to ON. Otherwise, it sets USE_FOO to OFF. If
# the status of USE_BAR or USE_ZOT ever changes, any value for the
# USE_FOO option is saved so that when the option is re-enabled it
# retains its old value.
#=============================================================================
# Copyright 2006-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CMAKE_DEPENDENT_OPTION option doc default depends force)
IF(${option}_ISSET MATCHES "^${option}_ISSET$")
SET(${option}_AVAILABLE 1)
FOREACH(d ${depends})
STRING(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
IF(${CMAKE_DEPENDENT_OPTION_DEP})
ELSE(${CMAKE_DEPENDENT_OPTION_DEP})
SET(${option}_AVAILABLE 0)
ENDIF(${CMAKE_DEPENDENT_OPTION_DEP})
ENDFOREACH(d)
IF(${option}_AVAILABLE)
OPTION(${option} "${doc}" "${default}")
SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
ELSE(${option}_AVAILABLE)
IF(${option} MATCHES "^${option}$")
ELSE(${option} MATCHES "^${option}$")
SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
ENDIF(${option} MATCHES "^${option}$")
SET(${option} ${force})
ENDIF(${option}_AVAILABLE)
ELSE(${option}_ISSET MATCHES "^${option}_ISSET$")
SET(${option} "${${option}_ISSET}")
ENDIF(${option}_ISSET MATCHES "^${option}_ISSET$")
ENDMACRO(CMAKE_DEPENDENT_OPTION)
|
31
CMake/Dependencies.cmake
Normal file
31
CMake/Dependencies.cmake
Normal file
@ -0,0 +1,31 @@
|
||||
#######################################################################
|
||||
# Find all necessary and optional CAUDIO dependencies
|
||||
#######################################################################
|
||||
|
||||
# CAUDIO_DEPENDENCIES_DIR can be used to specify a single base
|
||||
# folder where the required dependencies may be found.
|
||||
set(CAUDIO_DEPENDENCIES_DIR "" CACHE PATH "Path to prebuilt CAUDIO dependencies")
|
||||
|
||||
include(FindPkgMacros)
|
||||
getenv_path(CAUDIO_DEPENDENCIES_DIR)
|
||||
message(STATUS "Search path: ${CAUDIO_DEPENDENCIES_DIR}")
|
||||
|
||||
# give guesses as hints to the find_package calls
|
||||
set(CMAKE_PREFIX_PATH ${CAUDIO_DEPENDENCIES_DIR} ${CMAKE_PREFIX_PATH})
|
||||
set(CMAKE_FRAMEWORK_PATH ${CAUDIO_DEPENDENCIES_DIR} ${CMAKE_FRAMEWORK_PATH})
|
||||
|
||||
#######################################################################
|
||||
# Core dependencies
|
||||
#######################################################################
|
||||
|
||||
# Find OpenAL
|
||||
find_package(OpenAL)
|
||||
macro_log_feature(OPENAL_FOUND "OpenAL" "Support for Audio" "http://connect.creativelabs.com/openal/default.aspx" TRUE "" "")
|
||||
|
||||
# Display results, terminate if anything required is missing
|
||||
MACRO_DISPLAY_FEATURE_LOG()
|
||||
|
||||
# Add library and include paths from the dependencies
|
||||
include_directories(
|
||||
${OPENAL_INCLUDE_DIR}
|
||||
)
|
97
CMake/InstallDependencies.cmake
Normal file
97
CMake/InstallDependencies.cmake
Normal file
@ -0,0 +1,97 @@
|
||||
#####################################################
|
||||
# Install dependencies
|
||||
#####################################################
|
||||
if (NOT APPLE AND NOT WIN32)
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(CAUDIO_COPY_DEPENDENCIES "Copy dependency libs to the build directory" TRUE)
|
||||
|
||||
macro(copy_debug INPUT)
|
||||
if (EXISTS ${CAUDIO_DEPENDENCIES_DIR}/bin/debug/${INPUT})
|
||||
if (MINGW OR NMAKE)
|
||||
configure_file(${CAUDIO_DEPENDENCIES_DIR}/bin/debug/${INPUT} ${CMAKE_BINARY_DIR}/bin/${INPUT} COPYONLY)
|
||||
else ()
|
||||
configure_file(${CAUDIO_DEPENDENCIES_DIR}/bin/debug/${INPUT} ${CMAKE_BINARY_DIR}/bin/debug/${INPUT} COPYONLY)
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
macro(copy_release INPUT)
|
||||
if (EXISTS ${CAUDIO_DEPENDENCIES_DIR}/bin/release/${INPUT})
|
||||
if (MINGW OR NMAKE)
|
||||
configure_file(${CAUDIO_DEPENDENCIES_DIR}/bin/release/${INPUT} ${CMAKE_BINARY_DIR}/bin/${INPUT} COPYONLY)
|
||||
else ()
|
||||
configure_file(${CAUDIO_DEPENDENCIES_DIR}/bin/release/${INPUT} ${CMAKE_BINARY_DIR}/bin/release/${INPUT} COPYONLY)
|
||||
configure_file(${CAUDIO_DEPENDENCIES_DIR}/bin/release/${INPUT} ${CMAKE_BINARY_DIR}/bin/relwithdebinfo/${INPUT} COPYONLY)
|
||||
configure_file(${CAUDIO_DEPENDENCIES_DIR}/bin/release/${INPUT} ${CMAKE_BINARY_DIR}/bin/minsizerel/${INPUT} COPYONLY)
|
||||
endif ()
|
||||
endif ()
|
||||
endmacro ()
|
||||
|
||||
function(install_dll_file DEBUG_FILEPATH RELEASE_FILEPATH FILENAME)
|
||||
if (EXISTS ${DEBUG_FILEPATH}${FILENAME}_d.dll)
|
||||
install(FILES
|
||||
${DEBUG_FILEPATH}${FILENAME}_d.dll
|
||||
DESTINATION bin/debug CONFIGURATIONS Debug
|
||||
)
|
||||
install(FILES
|
||||
${RELEASE_FILEPATH}${FILENAME}.dll
|
||||
DESTINATION bin/release CONFIGURATIONS Release None ""
|
||||
)
|
||||
install(FILES
|
||||
${RELEASE_FILEPATH}${FILENAME}.dll
|
||||
DESTINATION bin/relwithdebinfo CONFIGURATIONS RelWithDebInfo
|
||||
)
|
||||
install(FILES
|
||||
${RELEASE_FILEPATH}${FILENAME}.dll
|
||||
DESTINATION bin/minsizerel CONFIGURATIONS MinSizeRel
|
||||
)
|
||||
|
||||
configure_file(${DEBUG_FILEPATH}${FILENAME}_d.dll ${CMAKE_BINARY_DIR}/bin/debug/${FILENAME}_d.dll COPYONLY)
|
||||
configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${CMAKE_BINARY_DIR}/bin/release/${FILENAME}.dll COPYONLY)
|
||||
configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${CMAKE_BINARY_DIR}/bin/relwithdebinfo/${FILENAME}.dll COPYONLY)
|
||||
configure_file(${RELEASE_FILEPATH}${FILENAME}.dll ${CMAKE_BINARY_DIR}/bin/minsizerel/${FILENAME}.dll COPYONLY)
|
||||
endif ()
|
||||
endfunction(install_dll_file)
|
||||
|
||||
function(install_all_targets TARGETNAME)
|
||||
install(TARGETS ${TARGETNAME}
|
||||
BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/bin${CAUDIO_RELEASE_PATH}" CONFIGURATIONS Release None ""
|
||||
RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/bin${CAUDIO_RELEASE_PATH}" CONFIGURATIONS Release None ""
|
||||
LIBRARY DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/${CAUDIO_RELEASE_PATH}" CONFIGURATIONS Release None ""
|
||||
ARCHIVE DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/${CAUDIO_RELEASE_PATH}" CONFIGURATIONS Release None ""
|
||||
FRAMEWORK DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/${CAUDIO_RELEASE_PATH}" CONFIGURATIONS Release None ""
|
||||
)
|
||||
install(TARGETS ${TARGETNAME}
|
||||
BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/bin${CAUDIO_DEBUG_PATH}" CONFIGURATIONS Debug
|
||||
RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/bin${CAUDIO_DEBUG_PATH}" CONFIGURATIONS Debug
|
||||
LIBRARY DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/${CAUDIO_DEBUG_PATH}" CONFIGURATIONS Debug
|
||||
ARCHIVE DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/${CAUDIO_DEBUG_PATH}" CONFIGURATIONS Debug
|
||||
FRAMEWORK DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/${CAUDIO_DEBUG_PATH}" CONFIGURATIONS Debug
|
||||
)
|
||||
install(TARGETS ${TARGETNAME}
|
||||
BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/bin/RelWithDebInfo" CONFIGURATIONS RelWithDebInfo
|
||||
RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/bin/RelWithDebInfo" CONFIGURATIONS RelWithDebInfo
|
||||
LIBRARY DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/RelWithDebInfo" CONFIGURATIONS RelWithDebInfo
|
||||
ARCHIVE DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/RelWithDebInfo" CONFIGURATIONS RelWithDebInfo
|
||||
FRAMEWORK DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/RelWithDebInfo" CONFIGURATIONS RelWithDebInfo
|
||||
)
|
||||
install(TARGETS ${TARGETNAME}
|
||||
BUNDLE DESTINATION "${CMAKE_BINARY_DIR}/bin/MinSizeRel" CONFIGURATIONS MinSizeRel
|
||||
RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/bin/MinSizeRel" CONFIGURATIONS MinSizeRel
|
||||
LIBRARY DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/MinSizeRel" CONFIGURATIONS MinSizeRel
|
||||
ARCHIVE DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/MinSizeRel" CONFIGURATIONS MinSizeRel
|
||||
FRAMEWORK DESTINATION "${CMAKE_BINARY_DIR}/${CAUDIO_LIB_DIRECTORY}/MinSizeRel" CONFIGURATIONS MinSizeRel
|
||||
)
|
||||
endfunction(install_all_targets)
|
||||
|
||||
if (CAUDIO_COPY_DEPENDENCIES)
|
||||
if (WIN32)
|
||||
copy_debug(OpenAL32.dll)
|
||||
copy_release(OpenAL32.dll)
|
||||
|
||||
copy_debug(wrap_oal.dll)
|
||||
copy_release(wrap_oal.dll)
|
||||
endif ()
|
||||
endif ()
|
49
CMake/Packages/FindOpenAL.cmake
Normal file
49
CMake/Packages/FindOpenAL.cmake
Normal file
@ -0,0 +1,49 @@
|
||||
# - Try to find OPENAL
|
||||
# Once done, this will define
|
||||
#
|
||||
# OPENAL_FOUND - system has OPENAL
|
||||
# OPENAL_INCLUDE_DIRS - the OPENAL include directories
|
||||
# OPENAL_LIBRARIES - link these to use OPENAL
|
||||
|
||||
include(FindPkgMacros)
|
||||
findpkg_begin(OPENAL)
|
||||
|
||||
# Get path, convert backslashes as ${ENV_${var}}
|
||||
getenv_path(OPENAL_HOME)
|
||||
|
||||
# construct search paths
|
||||
set(OPENAL_PREFIX_PATH ${OPENAL_HOME}
|
||||
${ENV_OPENAL_HOME}
|
||||
${CAUDIO_DEPENDENCIES_DIR}
|
||||
~/Library/Frameworks/OpenAL.framework/Headers
|
||||
/Library/Frameworks/OpenAL.framework/Headers
|
||||
/System/Library/Frameworks/OpenAL.framework/Headers # Tiger
|
||||
/usr/local/include/AL
|
||||
/usr/local/include/OpenAL
|
||||
/usr/local/include
|
||||
/usr/include/AL
|
||||
/usr/include/OpenAL
|
||||
/usr/include)
|
||||
|
||||
create_search_paths(OPENAL)
|
||||
# redo search if prefix path changed
|
||||
clear_if_changed(OPENAL_PREFIX_PATH
|
||||
OPENAL_LIBRARY_REL
|
||||
OPENAL_LIBRARY_DBG
|
||||
OPENAL_INCLUDE_DIR
|
||||
)
|
||||
|
||||
set(OPENAL_LIBRARY_NAMES OpenAL32)
|
||||
|
||||
get_debug_names(OPENAL_LIBRARY_NAMES)
|
||||
|
||||
find_path(OPENAL_INCLUDE_DIR NAMES al.h alc.h HINTS ${OPENAL_INC_SEARCH_PATH} PATH_SUFFIXES AL)
|
||||
find_library(OPENAL_LIBRARY_REL NAMES ${OPENAL_LIBRARY_NAMES} HINTS ${OPENAL_LIB_SEARCH_PATH} ${OPENAL_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" release relwithdebinfo minsizerel)
|
||||
find_library(OPENAL_LIBRARY_DBG NAMES ${OPENAL_LIBRARY_NAMES_DBG} HINTS ${OPENAL_LIB_SEARCH_PATH} ${OPENAL_PKGC_LIBRARY_DIRS} PATH_SUFFIXES "" debug)
|
||||
|
||||
add_parent_dir(OPENAL_INCLUDE_DIR OPENAL_INCLUDE_DIR)
|
||||
|
||||
make_library_set(OPENAL_LIBRARY)
|
||||
|
||||
findpkg_finish(OPENAL)
|
||||
|
161
CMake/Utils/FindPkgMacros.cmake
Normal file
161
CMake/Utils/FindPkgMacros.cmake
Normal file
@ -0,0 +1,161 @@
|
||||
#-------------------------------------------------------------------
|
||||
# This file is part of the CMake build system for OGRE
|
||||
# (Object-oriented Graphics Rendering Engine)
|
||||
# For the latest info, see http://www.ogre3d.org/
|
||||
#
|
||||
# The contents of this file are placed in the public domain. Feel
|
||||
# free to make use of it in any way you like.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
##################################################################
|
||||
# Provides some common functionality for the FindPackage modules
|
||||
##################################################################
|
||||
|
||||
# Begin processing of package
|
||||
macro(findpkg_begin PREFIX)
|
||||
if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
message(STATUS "Looking for ${PREFIX}...")
|
||||
endif ()
|
||||
endmacro(findpkg_begin)
|
||||
|
||||
# Display a status message unless FIND_QUIETLY is set
|
||||
macro(pkg_message PREFIX)
|
||||
if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
message(STATUS ${ARGN})
|
||||
endif ()
|
||||
endmacro(pkg_message)
|
||||
|
||||
# Get environment variable, define it as ENV_$var and make sure backslashes are converted to forward slashes
|
||||
macro(getenv_path VAR)
|
||||
set(ENV_${VAR} $ENV{${VAR}})
|
||||
# replace won't work if var is blank
|
||||
if (ENV_${VAR})
|
||||
string( REGEX REPLACE "\\\\" "/" ENV_${VAR} ${ENV_${VAR}} )
|
||||
endif ()
|
||||
endmacro(getenv_path)
|
||||
|
||||
# Construct search paths for includes and libraries from a PREFIX_PATH
|
||||
macro(create_search_paths PREFIX)
|
||||
foreach(dir ${${PREFIX}_PREFIX_PATH})
|
||||
set(${PREFIX}_INC_SEARCH_PATH ${${PREFIX}_INC_SEARCH_PATH}
|
||||
${dir}/include ${dir}/Include ${dir}/include/${PREFIX} ${dir}/Headers)
|
||||
set(${PREFIX}_LIB_SEARCH_PATH ${${PREFIX}_LIB_SEARCH_PATH}
|
||||
${dir}/lib ${dir}/Lib ${dir}/lib/${PREFIX} ${dir}/Libs)
|
||||
set(${PREFIX}_BIN_SEARCH_PATH ${${PREFIX}_BIN_SEARCH_PATH}
|
||||
${dir}/bin)
|
||||
endforeach(dir)
|
||||
set(${PREFIX}_FRAMEWORK_SEARCH_PATH ${${PREFIX}_PREFIX_PATH})
|
||||
endmacro(create_search_paths)
|
||||
|
||||
# clear cache variables if a certain variable changed
|
||||
macro(clear_if_changed TESTVAR)
|
||||
# test against internal check variable
|
||||
# HACK: Apparently, adding a variable to the cache cleans up the list
|
||||
# a bit. We need to also remove any empty strings from the list, but
|
||||
# at the same time ensure that we are actually dealing with a list.
|
||||
list(APPEND ${TESTVAR} "")
|
||||
list(REMOVE_ITEM ${TESTVAR} "")
|
||||
if (NOT "${${TESTVAR}}" STREQUAL "${${TESTVAR}_INT_CHECK}")
|
||||
message(STATUS "${TESTVAR} changed.")
|
||||
foreach(var ${ARGN})
|
||||
set(${var} "NOTFOUND" CACHE STRING "x" FORCE)
|
||||
endforeach(var)
|
||||
endif ()
|
||||
set(${TESTVAR}_INT_CHECK ${${TESTVAR}} CACHE INTERNAL "x" FORCE)
|
||||
endmacro(clear_if_changed)
|
||||
|
||||
# Try to get some hints from pkg-config, if available
|
||||
macro(use_pkgconfig PREFIX PKGNAME)
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(${PREFIX} ${PKGNAME})
|
||||
endif ()
|
||||
endmacro (use_pkgconfig)
|
||||
|
||||
# Couple a set of release AND debug libraries (or frameworks)
|
||||
macro(make_library_set PREFIX)
|
||||
if (${PREFIX}_FWK)
|
||||
set(${PREFIX} ${${PREFIX}_FWK})
|
||||
elseif (${PREFIX}_REL AND ${PREFIX}_DBG)
|
||||
set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG})
|
||||
elseif (${PREFIX}_REL)
|
||||
set(${PREFIX} ${${PREFIX}_REL})
|
||||
elseif (${PREFIX}_DBG)
|
||||
set(${PREFIX} ${${PREFIX}_DBG})
|
||||
endif ()
|
||||
endmacro(make_library_set)
|
||||
|
||||
# Generate debug names from given release names
|
||||
macro(get_debug_names PREFIX)
|
||||
foreach(i ${${PREFIX}})
|
||||
set(${PREFIX}_DBG ${${PREFIX}_DBG} ${i}d ${i}D ${i}_d ${i}_D ${i}_debug ${i})
|
||||
endforeach(i)
|
||||
endmacro(get_debug_names)
|
||||
|
||||
# Add the parent dir from DIR to VAR
|
||||
macro(add_parent_dir VAR DIR)
|
||||
get_filename_component(${DIR}_TEMP "${${DIR}}/.." ABSOLUTE)
|
||||
set(${VAR} ${${VAR}} ${${DIR}_TEMP})
|
||||
endmacro(add_parent_dir)
|
||||
|
||||
# Do the final processing for the package find.
|
||||
macro(findpkg_finish PREFIX)
|
||||
# skip if already processed during this run
|
||||
if (NOT ${PREFIX}_FOUND)
|
||||
if (${PREFIX}_INCLUDE_DIR AND ${PREFIX}_LIBRARY)
|
||||
set(${PREFIX}_FOUND TRUE)
|
||||
set(${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIR})
|
||||
set(${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARY})
|
||||
if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
message(STATUS "Found ${PREFIX}: ${${PREFIX}_LIBRARIES}")
|
||||
endif ()
|
||||
else ()
|
||||
if (NOT ${PREFIX}_FIND_QUIETLY)
|
||||
message(STATUS "Could not locate ${PREFIX}")
|
||||
endif ()
|
||||
if (${PREFIX}_FIND_REQUIRED)
|
||||
message(FATAL_ERROR "Required library ${PREFIX} not found! Install the library (including dev packages) and try again. If the library is already installed, set the missing variables manually in cmake.")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
mark_as_advanced(${PREFIX}_INCLUDE_DIR ${PREFIX}_LIBRARY ${PREFIX}_LIBRARY_REL ${PREFIX}_LIBRARY_DBG ${PREFIX}_LIBRARY_FWK)
|
||||
endif ()
|
||||
endmacro(findpkg_finish)
|
||||
|
||||
|
||||
# Slightly customised framework finder
|
||||
MACRO(findpkg_framework fwk)
|
||||
IF(APPLE)
|
||||
SET(${fwk}_FRAMEWORK_PATH
|
||||
${${fwk}_FRAMEWORK_SEARCH_PATH}
|
||||
${CMAKE_FRAMEWORK_PATH}
|
||||
~/Library/Frameworks
|
||||
/Library/Frameworks
|
||||
/System/Library/Frameworks
|
||||
/Network/Library/Frameworks
|
||||
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/Frameworks/
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/Release
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/Debug
|
||||
)
|
||||
# These could be arrays of paths, add each individually to the search paths
|
||||
foreach(i ${OGRE_PREFIX_PATH})
|
||||
set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
|
||||
endforeach(i)
|
||||
|
||||
foreach(i ${OGRE_PREFIX_BUILD})
|
||||
set(${fwk}_FRAMEWORK_PATH ${${fwk}_FRAMEWORK_PATH} ${i}/lib/Release ${i}/lib/Debug)
|
||||
endforeach(i)
|
||||
|
||||
FOREACH(dir ${${fwk}_FRAMEWORK_PATH})
|
||||
SET(fwkpath ${dir}/${fwk}.framework)
|
||||
IF(EXISTS ${fwkpath})
|
||||
SET(${fwk}_FRAMEWORK_INCLUDES ${${fwk}_FRAMEWORK_INCLUDES}
|
||||
${fwkpath}/Headers ${fwkpath}/PrivateHeaders)
|
||||
SET(${fwk}_FRAMEWORK_PATH ${dir})
|
||||
if (NOT ${fwk}_LIBRARY_FWK)
|
||||
SET(${fwk}_LIBRARY_FWK "-framework ${fwk}")
|
||||
endif ()
|
||||
ENDIF(EXISTS ${fwkpath})
|
||||
ENDFOREACH(dir)
|
||||
ENDIF(APPLE)
|
||||
ENDMACRO(findpkg_framework)
|
134
CMake/Utils/MacroLogFeature.cmake
Normal file
134
CMake/Utils/MacroLogFeature.cmake
Normal file
@ -0,0 +1,134 @@
|
||||
#-------------------------------------------------------------------
|
||||
# This file is part of the CMake build system for OGRE
|
||||
# (Object-oriented Graphics Rendering Engine)
|
||||
# For the latest info, see http://www.ogre3d.org/
|
||||
#
|
||||
# The contents of this file are placed in the public domain. Feel
|
||||
# free to make use of it in any way you like.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
# This file defines the Feature Logging macros.
|
||||
#
|
||||
# MACRO_LOG_FEATURE(VAR FEATURE DESCRIPTION URL [REQUIRED [MIN_VERSION [COMMENTS]]])
|
||||
# Logs the information so that it can be displayed at the end
|
||||
# of the configure run
|
||||
# VAR : TRUE or FALSE, indicating whether the feature is supported
|
||||
# FEATURE: name of the feature, e.g. "libjpeg"
|
||||
# DESCRIPTION: description what this feature provides
|
||||
# URL: home page
|
||||
# REQUIRED: TRUE or FALSE, indicating whether the featue is required
|
||||
# MIN_VERSION: minimum version number. empty string if unneeded
|
||||
# COMMENTS: More info you may want to provide. empty string if unnecessary
|
||||
#
|
||||
# MACRO_DISPLAY_FEATURE_LOG()
|
||||
# Call this to display the collected results.
|
||||
# Exits CMake with a FATAL error message if a required feature is missing
|
||||
#
|
||||
# Example:
|
||||
#
|
||||
# INCLUDE(MacroLogFeature)
|
||||
#
|
||||
# FIND_PACKAGE(JPEG)
|
||||
# MACRO_LOG_FEATURE(JPEG_FOUND "libjpeg" "Support JPEG images" "http://www.ijg.org" TRUE "3.2a" "")
|
||||
# ...
|
||||
# MACRO_DISPLAY_FEATURE_LOG()
|
||||
|
||||
# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
|
||||
# Copyright (c) 2006, Allen Winter, <winter@kde.org>
|
||||
#
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
IF (NOT _macroLogFeatureAlreadyIncluded)
|
||||
SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(REMOVE ${_file})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(REMOVE ${_file})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(REMOVE ${_file})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_macroLogFeatureAlreadyIncluded TRUE)
|
||||
ENDIF (NOT _macroLogFeatureAlreadyIncluded)
|
||||
|
||||
|
||||
MACRO(MACRO_LOG_FEATURE _var _package _description _url ) # _required _minvers _comments)
|
||||
|
||||
SET(_required "${ARGV4}")
|
||||
SET(_minvers "${ARGV5}")
|
||||
SET(_comments "${ARGV6}")
|
||||
|
||||
IF (${_var})
|
||||
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
|
||||
ELSE (${_var})
|
||||
IF (${_required} MATCHES "[Tt][Rr][Uu][Ee]")
|
||||
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
|
||||
ELSE (${_required} MATCHES "[Tt][Rr][Uu][Ee]")
|
||||
SET(_LOGFILENAME ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
|
||||
ENDIF (${_required} MATCHES "[Tt][Rr][Uu][Ee]")
|
||||
ENDIF (${_var})
|
||||
|
||||
SET(_logtext "+ ${_package}")
|
||||
|
||||
IF (NOT ${_var})
|
||||
IF (${_minvers} MATCHES ".*")
|
||||
SET(_logtext "${_logtext}, ${_minvers}")
|
||||
ENDIF (${_minvers} MATCHES ".*")
|
||||
SET(_logtext "${_logtext}: ${_description} <${_url}>")
|
||||
IF (${_comments} MATCHES ".*")
|
||||
SET(_logtext "${_logtext}\n${_comments}")
|
||||
ENDIF (${_comments} MATCHES ".*")
|
||||
# SET(_logtext "${_logtext}\n") #double-space missing features?
|
||||
ENDIF (NOT ${_var})
|
||||
FILE(APPEND "${_LOGFILENAME}" "${_logtext}\n")
|
||||
|
||||
ENDMACRO(MACRO_LOG_FEATURE)
|
||||
|
||||
|
||||
MACRO(MACRO_DISPLAY_FEATURE_LOG)
|
||||
|
||||
SET(_file ${CMAKE_BINARY_DIR}/MissingRequirements.txt)
|
||||
IF (EXISTS ${_file})
|
||||
FILE(READ ${_file} _requirements)
|
||||
MESSAGE(FATAL_ERROR "\n-----------------------------------------------------------------------------\n-- The following REQUIRED packages could NOT be located on your system.\n-- Please install them before continuing this software installation.\n-- If you are in Windows, try passing -DCAUDIO_DEPENDENCIES_DIR=<path to dependencies>\n-----------------------------------------------------------------------------\n${_requirements}-----------------------------------------------------------------------------")
|
||||
FILE(REMOVE ${_file})
|
||||
MESSAGE(FATAL_ERROR "Exiting: Missing Requirements")
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_summary "\n")
|
||||
|
||||
SET(_elist 0)
|
||||
SET(_file ${CMAKE_BINARY_DIR}/EnabledFeatures.txt)
|
||||
IF (EXISTS ${_file})
|
||||
SET(_elist 1)
|
||||
FILE(READ ${_file} _enabled)
|
||||
FILE(REMOVE ${_file})
|
||||
SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following external packages were located on your system.\n-- This installation will have the extra features provided by these packages.\n${_enabled}")
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
SET(_dlist 0)
|
||||
SET(_file ${CMAKE_BINARY_DIR}/DisabledFeatures.txt)
|
||||
IF (EXISTS ${_file})
|
||||
SET(_dlist 1)
|
||||
FILE(READ ${_file} _disabled)
|
||||
FILE(REMOVE ${_file})
|
||||
SET(_summary "${_summary}-----------------------------------------------------------------------------\n-- The following OPTIONAL packages could NOT be located on your system.\n-- Consider installing them to enable more features from this software.\n${_disabled}")
|
||||
ELSE (EXISTS ${_file})
|
||||
IF (${_elist})
|
||||
SET(_summary "${_summary}Congratulations! All external packages have been found.\n")
|
||||
ENDIF (${_elist})
|
||||
ENDIF (EXISTS ${_file})
|
||||
|
||||
IF (${_elist} OR ${_dlist})
|
||||
SET(_summary "${_summary}-----------------------------------------------------------------------------\n")
|
||||
ENDIF (${_elist} OR ${_dlist})
|
||||
MESSAGE(STATUS "${_summary}")
|
||||
|
||||
ENDMACRO(MACRO_DISPLAY_FEATURE_LOG)
|
63
CMake/Utils/PrecompiledHeader.cmake
Normal file
63
CMake/Utils/PrecompiledHeader.cmake
Normal file
@ -0,0 +1,63 @@
|
||||
#-------------------------------------------------------------------
|
||||
# This file is part of the CMake build system for OGRE
|
||||
# (Object-oriented Graphics Rendering Engine)
|
||||
# For the latest info, see http://www.ogre3d.org/
|
||||
#
|
||||
# The contents of this file are placed in the public domain. Feel
|
||||
# free to make use of it in any way you like.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
##################################################################
|
||||
# Support macro to use a precompiled header
|
||||
# Usage:
|
||||
# use_precompiled_header(TARGET HEADER_FILE SRC_FILE)
|
||||
##################################################################
|
||||
|
||||
macro(use_precompiled_header TARGET HEADER_FILE SRC_FILE)
|
||||
get_filename_component(HEADER ${HEADER_FILE} NAME)
|
||||
|
||||
if (MSVC)
|
||||
add_definitions(/Yu"${HEADER}")
|
||||
set_source_files_properties(${SRC_FILE}
|
||||
PPROPERTIES COMPILE_FLAGS /Yc"${HEADER}"
|
||||
)
|
||||
|
||||
elseif (CMAKE_COMPILER_IS_GNUCXX)
|
||||
# disabled because it seems to increase compile time
|
||||
## this is some serious hack... we definitely need native
|
||||
## support in CMake for this!
|
||||
## we will generate the precompiled header via a workaround
|
||||
## first give the header a new name with the proper extension
|
||||
#set(PRECOMP_HEADER ${CMAKE_CURRENT_BINARY_DIR}/hacked/${HEADER}.gch)
|
||||
#configure_file(${HEADER_FILE} ${PRECOMP_HEADER} COPYONLY)
|
||||
## retrieve some info about the target's build settings
|
||||
#get_target_property(${TARGET} PRECOMP_TYPE TYPE)
|
||||
#if (PRECOMP_TYPE STREQUAL "SHARED_LIBRARY")
|
||||
# set(PRECOMP_LIBTYPE "SHARED")
|
||||
#else ()
|
||||
# set(PRECOMP_LIBTYPE "STATIC")
|
||||
#endif ()
|
||||
#get_target_property(${TARGET} PRECOMP_DEFINITIONS COMPILE_DEFINITIONS)
|
||||
#get_target_property(${TARGET} PRECOMP_FLAGS COMPILE_FLAGS)
|
||||
#
|
||||
## add a new target which compiles the header
|
||||
#add_library(__precomp_header ${PRECOMP_LIBTYPE} ${PRECOMP_HEADER})
|
||||
#add_dependencies(${TARGET} __precomp_header)
|
||||
#set_target_properties(__precomp_header PROPERTIES
|
||||
# COMPILE_DEFINITIONS ${PRECOMP_DEFINITIONS}
|
||||
# COMPILE_FLAGS ${PRECOMP_FLAGS}
|
||||
# HAS_CXX TRUE
|
||||
#)
|
||||
#set_source_files_properties(${PRECOMP_HEADER} PROPERTIES
|
||||
# HEADER_FILE_ONLY FALSE
|
||||
# KEEP_EXTENSION TRUE
|
||||
# COMPILE_FLAGS "-x c++-header"
|
||||
# LANGUAGE CXX
|
||||
#)
|
||||
#
|
||||
## finally, we need to ensure that gcc can find the precompiled header
|
||||
## this is another dirty hack
|
||||
#include_directories(BEFORE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/__precomp_header.dir/hacked")
|
||||
|
||||
endif ()
|
||||
endmacro(use_precompiled_header)
|
60
CMake/Utils/PreprocessorUtils.cmake
Normal file
60
CMake/Utils/PreprocessorUtils.cmake
Normal file
@ -0,0 +1,60 @@
|
||||
#-------------------------------------------------------------------
|
||||
# This file is part of the CMake build system for OGRE
|
||||
# (Object-oriented Graphics Rendering Engine)
|
||||
# For the latest info, see http://www.ogre3d.org/
|
||||
#
|
||||
# The contents of this file are placed in the public domain. Feel
|
||||
# free to make use of it in any way you like.
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
macro(get_preprocessor_entry CONTENTS KEYWORD VARIABLE)
|
||||
string(REGEX MATCH
|
||||
"# *define +${KEYWORD} +((\"([^\n]*)\")|([^ \n]*))"
|
||||
PREPROC_TEMP_VAR
|
||||
${${CONTENTS}}
|
||||
)
|
||||
if (CMAKE_MATCH_3)
|
||||
set(${VARIABLE} ${CMAKE_MATCH_3})
|
||||
else ()
|
||||
set(${VARIABLE} ${CMAKE_MATCH_4})
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
macro(has_preprocessor_entry CONTENTS KEYWORD VARIABLE)
|
||||
string(REGEX MATCH
|
||||
"\n *# *define +(${KEYWORD})"
|
||||
PREPROC_TEMP_VAR
|
||||
${${CONTENTS}}
|
||||
)
|
||||
if (CMAKE_MATCH_1)
|
||||
set(${VARIABLE} TRUE)
|
||||
else ()
|
||||
set(${VARIABLE} FALSE)
|
||||
endif ()
|
||||
endmacro()
|
||||
|
||||
macro(replace_preprocessor_entry VARIABLE KEYWORD NEW_VALUE)
|
||||
string(REGEX REPLACE
|
||||
"(// *)?# *define +${KEYWORD} +[^ \n]*"
|
||||
"#define ${KEYWORD} ${NEW_VALUE}"
|
||||
${VARIABLE}_TEMP
|
||||
${${VARIABLE}}
|
||||
)
|
||||
set(${VARIABLE} ${${VARIABLE}_TEMP})
|
||||
endmacro()
|
||||
|
||||
macro(set_preprocessor_entry VARIABLE KEYWORD ENABLE)
|
||||
if (${ENABLE})
|
||||
set(TMP_REPLACE_STR "#define ${KEYWORD}")
|
||||
else ()
|
||||
set(TMP_REPLACE_STR "// #define ${KEYWORD}")
|
||||
endif ()
|
||||
string(REGEX REPLACE
|
||||
"(// *)?# *define +${KEYWORD} *\n"
|
||||
${TMP_REPLACE_STR}
|
||||
${VARIABLE}_TEMP
|
||||
${${VARIABLE}}
|
||||
)
|
||||
set(${VARIABLE} ${${VARIABLE}_TEMP})
|
||||
endmacro()
|
||||
|
120
CMakeLists.txt
Normal file
120
CMakeLists.txt
Normal file
@ -0,0 +1,120 @@
|
||||
#/**********************************************************\
|
||||
#Original Author: Murat Sari (wolfmanfx)
|
||||
#
|
||||
#Created: Feb 20, 2011
|
||||
#License: ZLib
|
||||
#
|
||||
#\**********************************************************/
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
project(cAudio)
|
||||
|
||||
# Include necessary submodules
|
||||
set(CMAKE_MODULE_PATH
|
||||
"${CMAKE_SOURCE_DIR}/CMake"
|
||||
"${CMAKE_SOURCE_DIR}/CMake/Utils"
|
||||
"${CMAKE_SOURCE_DIR}/CMake/Packages"
|
||||
)
|
||||
|
||||
include(CMakeDependentOption)
|
||||
include(PreprocessorUtils)
|
||||
include(MacroLogFeature)
|
||||
|
||||
#####################################################################
|
||||
# Set up the basic build environment
|
||||
#####################################################################
|
||||
|
||||
if (CMAKE_BUILD_TYPE STREQUAL "")
|
||||
# CMake defaults to leaving CMAKE_BUILD_TYPE empty. This screws up
|
||||
# differentiation between debug and release builds.
|
||||
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None (CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." FORCE)
|
||||
endif ()
|
||||
|
||||
if (WIN32)
|
||||
# Create debug libraries with _d postfix
|
||||
set(CMAKE_DEBUG_POSTFIX "_d")
|
||||
endif()
|
||||
|
||||
|
||||
set(CAUDIO_RELEASE_PATH "/Release")
|
||||
set(CAUDIO_RELWDBG_PATH "/RelWithDebInfo")
|
||||
set(CAUDIO_MINSIZE_PATH "/MinSizeRel")
|
||||
set(CAUDIO_DEBUG_PATH "/Debug")
|
||||
set(CAUDIO_LIB_DIRECTORY "/lib")
|
||||
|
||||
######################################################################
|
||||
# Provide user options to customise the build process
|
||||
######################################################################
|
||||
|
||||
# Customise what to build
|
||||
option(CAUDIO_STATIC "Static build" FALSE)
|
||||
option(CAUDIO_BUILD_SAMPLES "Build Samples" TRUE)
|
||||
option(CAUDIO_BUILD_EAX_PLUGIN "Build EAXLegacyPreset Plugin" FALSE)
|
||||
option(CAUDIO_BUILD_MP3DECODER_PLUGIN "Build mp3Decoder Plugin" FALSE)
|
||||
|
||||
if(APPLE)
|
||||
option(CAUDIO_IOS_BUILD "Build for ios" FALSE)
|
||||
endif()
|
||||
|
||||
if(CAUDIO_STATIC)
|
||||
set(CAUDIO_LIB_TYPE STATIC)
|
||||
else()
|
||||
set(CAUDIO_LIB_TYPE SHARED)
|
||||
endif()
|
||||
|
||||
if (CAUDIO_IOS_BUILD)
|
||||
# Set build variables
|
||||
set(CMAKE_OSX_SYSROOT iphoneos)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "")
|
||||
set(CMAKE_EXE_LINKER_FLAGS "-framework Foundation -framework CoreGraphics -framework QuartzCore -framework UIKit -framework OpenGLES")
|
||||
set(XCODE_ATTRIBUTE_SDKROOT iphoneos)
|
||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER "com.YOUR_COMPANY.\${PRODUCT_NAME:rfc1034identifier}")
|
||||
|
||||
set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_32_BIT))
|
||||
|
||||
add_definitions(-fno-regmove)
|
||||
add_definitions(-falign-loops=16)
|
||||
remove_definitions(-msse)
|
||||
|
||||
elseif (APPLE AND NOT CAUDIO_IOS_BUILD)
|
||||
|
||||
# Set 10.5 as the base SDK by default
|
||||
set(XCODE_ATTRIBUTE_SDKROOT macosx)
|
||||
set(CMAKE_OSX_SYSROOT macosx)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5)
|
||||
|
||||
if (NOT CMAKE_OSX_ARCHITECTURES)
|
||||
set(CMAKE_OSX_ARCHITECTURES $(ARCHS_STANDARD_32_64_BIT))
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(Dependencies)
|
||||
include(InstallDependencies)
|
||||
|
||||
add_subdirectory(DependenciesSource/libogg-1.2.2)
|
||||
add_subdirectory(DependenciesSource/libvorbis-1.3.2)
|
||||
|
||||
if(CAUDIO_BUILD_EAX_PLUGIN)
|
||||
ADD_DEFINITIONS(-DCAUDIO_EFX_ENABLED)
|
||||
endif()
|
||||
|
||||
add_subdirectory(cAudio)
|
||||
|
||||
if(CAUDIO_BUILD_EAX_PLUGIN)
|
||||
add_subdirectory(Plugins/EAXLegacyPreset)
|
||||
endif()
|
||||
|
||||
if(CAUDIO_BUILD_MP3DECODER_PLUGIN)
|
||||
add_subdirectory(Plugins/mp3Decoder)
|
||||
endif()
|
||||
|
||||
if(CAUDIO_BUILD_SAMPLES)
|
||||
ADD_DEFINITIONS(-DCAUDIO_MEDIA_ROOT="${CMAKE_SOURCE_DIR}/Samples/Media/")
|
||||
add_subdirectory(Samples/Tutorial1_2DSound)
|
||||
add_subdirectory(Samples/Tutorial2_3DSound)
|
||||
add_subdirectory(Samples/Tutorial3_MemoryPlayback)
|
||||
add_subdirectory(Samples/Tutorial4_AudioCapture)
|
||||
add_subdirectory(Samples/Tutorial5_AudioEffects)
|
||||
add_subdirectory(Samples/Tutorial6_CustomEventHandler)
|
||||
add_subdirectory(Samples/Tutorial7_CustomLogReceiver)
|
||||
endif()
|
BIN
Dependencies/bin/debug/OpenAL32.dll
vendored
Normal file
BIN
Dependencies/bin/debug/OpenAL32.dll
vendored
Normal file
Binary file not shown.
BIN
Dependencies/bin/debug/wrap_oal.dll
vendored
Normal file
BIN
Dependencies/bin/debug/wrap_oal.dll
vendored
Normal file
Binary file not shown.
BIN
Dependencies/bin/release/OpenAL32.dll
vendored
Normal file
BIN
Dependencies/bin/release/OpenAL32.dll
vendored
Normal file
Binary file not shown.
BIN
Dependencies/bin/release/wrap_oal.dll
vendored
Normal file
BIN
Dependencies/bin/release/wrap_oal.dll
vendored
Normal file
Binary file not shown.
724
Dependencies/include/OpenAL/AL/al.h
vendored
Normal file
724
Dependencies/include/OpenAL/AL/al.h
vendored
Normal file
@ -0,0 +1,724 @@
|
||||
#ifndef AL_AL_H
|
||||
#define AL_AL_H
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(AL_LIBTYPE_STATIC)
|
||||
#define AL_API
|
||||
#elif defined(_WIN32) && !defined(_XBOX)
|
||||
#if defined(AL_BUILD_LIBRARY)
|
||||
#define AL_API __declspec(dllexport)
|
||||
#else
|
||||
#define AL_API __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#if defined(AL_BUILD_LIBRARY) && defined(HAVE_GCC_VISIBILITY)
|
||||
#define AL_API __attribute__((visibility("protected")))
|
||||
#else
|
||||
#define AL_API extern
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define AL_APIENTRY __cdecl
|
||||
#else
|
||||
#define AL_APIENTRY
|
||||
#endif
|
||||
|
||||
#if defined(TARGET_OS_MAC) && TARGET_OS_MAC
|
||||
#pragma export on
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The OPENAL, ALAPI, ALAPIENTRY, AL_INVALID, AL_ILLEGAL_ENUM, and
|
||||
* AL_ILLEGAL_COMMAND macros are deprecated, but are included for
|
||||
* applications porting code from AL 1.0
|
||||
*/
|
||||
#define OPENAL
|
||||
#define ALAPI AL_API
|
||||
#define ALAPIENTRY AL_APIENTRY
|
||||
#define AL_INVALID (-1)
|
||||
#define AL_ILLEGAL_ENUM AL_INVALID_ENUM
|
||||
#define AL_ILLEGAL_COMMAND AL_INVALID_OPERATION
|
||||
|
||||
#define AL_VERSION_1_0
|
||||
#define AL_VERSION_1_1
|
||||
|
||||
|
||||
/** 8-bit boolean */
|
||||
typedef char ALboolean;
|
||||
|
||||
/** character */
|
||||
typedef char ALchar;
|
||||
|
||||
/** signed 8-bit 2's complement integer */
|
||||
typedef signed char ALbyte;
|
||||
|
||||
/** unsigned 8-bit integer */
|
||||
typedef unsigned char ALubyte;
|
||||
|
||||
/** signed 16-bit 2's complement integer */
|
||||
typedef short ALshort;
|
||||
|
||||
/** unsigned 16-bit integer */
|
||||
typedef unsigned short ALushort;
|
||||
|
||||
/** signed 32-bit 2's complement integer */
|
||||
typedef int ALint;
|
||||
|
||||
/** unsigned 32-bit integer */
|
||||
typedef unsigned int ALuint;
|
||||
|
||||
/** non-negative 32-bit binary integer size */
|
||||
typedef int ALsizei;
|
||||
|
||||
/** enumerated 32-bit value */
|
||||
typedef int ALenum;
|
||||
|
||||
/** 32-bit IEEE754 floating-point */
|
||||
typedef float ALfloat;
|
||||
|
||||
/** 64-bit IEEE754 floating-point */
|
||||
typedef double ALdouble;
|
||||
|
||||
/** void type (for opaque pointers only) */
|
||||
typedef void ALvoid;
|
||||
|
||||
|
||||
/* Enumerant values begin at column 50. No tabs. */
|
||||
|
||||
/* "no distance model" or "no buffer" */
|
||||
#define AL_NONE 0
|
||||
|
||||
/* Boolean False. */
|
||||
#define AL_FALSE 0
|
||||
|
||||
/** Boolean True. */
|
||||
#define AL_TRUE 1
|
||||
|
||||
/** Indicate Source has relative coordinates. */
|
||||
#define AL_SOURCE_RELATIVE 0x202
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Directional source, inner cone angle, in degrees.
|
||||
* Range: [0-360]
|
||||
* Default: 360
|
||||
*/
|
||||
#define AL_CONE_INNER_ANGLE 0x1001
|
||||
|
||||
/**
|
||||
* Directional source, outer cone angle, in degrees.
|
||||
* Range: [0-360]
|
||||
* Default: 360
|
||||
*/
|
||||
#define AL_CONE_OUTER_ANGLE 0x1002
|
||||
|
||||
/**
|
||||
* Specify the pitch to be applied at source.
|
||||
* Range: [0.5-2.0]
|
||||
* Default: 1.0
|
||||
*/
|
||||
#define AL_PITCH 0x1003
|
||||
|
||||
/**
|
||||
* Specify the current location in three dimensional space.
|
||||
* OpenAL, like OpenGL, uses a right handed coordinate system,
|
||||
* where in a frontal default view X (thumb) points right,
|
||||
* Y points up (index finger), and Z points towards the
|
||||
* viewer/camera (middle finger).
|
||||
* To switch from a left handed coordinate system, flip the
|
||||
* sign on the Z coordinate.
|
||||
* Listener position is always in the world coordinate system.
|
||||
*/
|
||||
#define AL_POSITION 0x1004
|
||||
|
||||
/** Specify the current direction. */
|
||||
#define AL_DIRECTION 0x1005
|
||||
|
||||
/** Specify the current velocity in three dimensional space. */
|
||||
#define AL_VELOCITY 0x1006
|
||||
|
||||
/**
|
||||
* Indicate whether source is looping.
|
||||
* Type: ALboolean?
|
||||
* Range: [AL_TRUE, AL_FALSE]
|
||||
* Default: FALSE.
|
||||
*/
|
||||
#define AL_LOOPING 0x1007
|
||||
|
||||
/**
|
||||
* Indicate the buffer to provide sound samples.
|
||||
* Type: ALuint.
|
||||
* Range: any valid Buffer id.
|
||||
*/
|
||||
#define AL_BUFFER 0x1009
|
||||
|
||||
/**
|
||||
* Indicate the gain (volume amplification) applied.
|
||||
* Type: ALfloat.
|
||||
* Range: ]0.0- ]
|
||||
* A value of 1.0 means un-attenuated/unchanged.
|
||||
* Each division by 2 equals an attenuation of -6dB.
|
||||
* Each multiplicaton with 2 equals an amplification of +6dB.
|
||||
* A value of 0.0 is meaningless with respect to a logarithmic
|
||||
* scale; it is interpreted as zero volume - the channel
|
||||
* is effectively disabled.
|
||||
*/
|
||||
#define AL_GAIN 0x100A
|
||||
|
||||
/*
|
||||
* Indicate minimum source attenuation
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* Logarthmic
|
||||
*/
|
||||
#define AL_MIN_GAIN 0x100D
|
||||
|
||||
/**
|
||||
* Indicate maximum source attenuation
|
||||
* Type: ALfloat
|
||||
* Range: [0.0 - 1.0]
|
||||
*
|
||||
* Logarthmic
|
||||
*/
|
||||
#define AL_MAX_GAIN 0x100E
|
||||
|
||||
/**
|
||||
* Indicate listener orientation.
|
||||
*
|
||||
* at/up
|
||||
*/
|
||||
#define AL_ORIENTATION 0x100F
|
||||
|
||||
/**
|
||||
* Source state information.
|
||||
*/
|
||||
#define AL_SOURCE_STATE 0x1010
|
||||
#define AL_INITIAL 0x1011
|
||||
#define AL_PLAYING 0x1012
|
||||
#define AL_PAUSED 0x1013
|
||||
#define AL_STOPPED 0x1014
|
||||
|
||||
/**
|
||||
* Buffer Queue params
|
||||
*/
|
||||
#define AL_BUFFERS_QUEUED 0x1015
|
||||
#define AL_BUFFERS_PROCESSED 0x1016
|
||||
|
||||
/**
|
||||
* Source buffer position information
|
||||
*/
|
||||
#define AL_SEC_OFFSET 0x1024
|
||||
#define AL_SAMPLE_OFFSET 0x1025
|
||||
#define AL_BYTE_OFFSET 0x1026
|
||||
|
||||
/*
|
||||
* Source type (Static, Streaming or undetermined)
|
||||
* Source is Static if a Buffer has been attached using AL_BUFFER
|
||||
* Source is Streaming if one or more Buffers have been attached using alSourceQueueBuffers
|
||||
* Source is undetermined when it has the NULL buffer attached
|
||||
*/
|
||||
#define AL_SOURCE_TYPE 0x1027
|
||||
#define AL_STATIC 0x1028
|
||||
#define AL_STREAMING 0x1029
|
||||
#define AL_UNDETERMINED 0x1030
|
||||
|
||||
/** Sound samples: format specifier. */
|
||||
#define AL_FORMAT_MONO8 0x1100
|
||||
#define AL_FORMAT_MONO16 0x1101
|
||||
#define AL_FORMAT_STEREO8 0x1102
|
||||
#define AL_FORMAT_STEREO16 0x1103
|
||||
|
||||
/**
|
||||
* source specific reference distance
|
||||
* Type: ALfloat
|
||||
* Range: 0.0 - +inf
|
||||
*
|
||||
* At 0.0, no distance attenuation occurs. Default is
|
||||
* 1.0.
|
||||
*/
|
||||
#define AL_REFERENCE_DISTANCE 0x1020
|
||||
|
||||
/**
|
||||
* source specific rolloff factor
|
||||
* Type: ALfloat
|
||||
* Range: 0.0 - +inf
|
||||
*
|
||||
*/
|
||||
#define AL_ROLLOFF_FACTOR 0x1021
|
||||
|
||||
/**
|
||||
* Directional source, outer cone gain.
|
||||
*
|
||||
* Default: 0.0
|
||||
* Range: [0.0 - 1.0]
|
||||
* Logarithmic
|
||||
*/
|
||||
#define AL_CONE_OUTER_GAIN 0x1022
|
||||
|
||||
/**
|
||||
* Indicate distance above which sources are not
|
||||
* attenuated using the inverse clamped distance model.
|
||||
*
|
||||
* Default: +inf
|
||||
* Type: ALfloat
|
||||
* Range: 0.0 - +inf
|
||||
*/
|
||||
#define AL_MAX_DISTANCE 0x1023
|
||||
|
||||
/**
|
||||
* Sound samples: frequency, in units of Hertz [Hz].
|
||||
* This is the number of samples per second. Half of the
|
||||
* sample frequency marks the maximum significant
|
||||
* frequency component.
|
||||
*/
|
||||
#define AL_FREQUENCY 0x2001
|
||||
#define AL_BITS 0x2002
|
||||
#define AL_CHANNELS 0x2003
|
||||
#define AL_SIZE 0x2004
|
||||
|
||||
/**
|
||||
* Buffer state.
|
||||
*
|
||||
* Not supported for public use (yet).
|
||||
*/
|
||||
#define AL_UNUSED 0x2010
|
||||
#define AL_PENDING 0x2011
|
||||
#define AL_PROCESSED 0x2012
|
||||
|
||||
|
||||
/** Errors: No Error. */
|
||||
#define AL_NO_ERROR AL_FALSE
|
||||
|
||||
/**
|
||||
* Invalid Name paramater passed to AL call.
|
||||
*/
|
||||
#define AL_INVALID_NAME 0xA001
|
||||
|
||||
/**
|
||||
* Invalid parameter passed to AL call.
|
||||
*/
|
||||
#define AL_INVALID_ENUM 0xA002
|
||||
|
||||
/**
|
||||
* Invalid enum parameter value.
|
||||
*/
|
||||
#define AL_INVALID_VALUE 0xA003
|
||||
|
||||
/**
|
||||
* Illegal call.
|
||||
*/
|
||||
#define AL_INVALID_OPERATION 0xA004
|
||||
|
||||
|
||||
/**
|
||||
* No mojo.
|
||||
*/
|
||||
#define AL_OUT_OF_MEMORY 0xA005
|
||||
|
||||
|
||||
/** Context strings: Vendor Name. */
|
||||
#define AL_VENDOR 0xB001
|
||||
#define AL_VERSION 0xB002
|
||||
#define AL_RENDERER 0xB003
|
||||
#define AL_EXTENSIONS 0xB004
|
||||
|
||||
/** Global tweakage. */
|
||||
|
||||
/**
|
||||
* Doppler scale. Default 1.0
|
||||
*/
|
||||
#define AL_DOPPLER_FACTOR 0xC000
|
||||
|
||||
/**
|
||||
* Tweaks speed of propagation.
|
||||
*/
|
||||
#define AL_DOPPLER_VELOCITY 0xC001
|
||||
|
||||
/**
|
||||
* Speed of Sound in units per second
|
||||
*/
|
||||
#define AL_SPEED_OF_SOUND 0xC003
|
||||
|
||||
/**
|
||||
* Distance models
|
||||
*
|
||||
* used in conjunction with DistanceModel
|
||||
*
|
||||
* implicit: NONE, which disances distance attenuation.
|
||||
*/
|
||||
#define AL_DISTANCE_MODEL 0xD000
|
||||
#define AL_INVERSE_DISTANCE 0xD001
|
||||
#define AL_INVERSE_DISTANCE_CLAMPED 0xD002
|
||||
#define AL_LINEAR_DISTANCE 0xD003
|
||||
#define AL_LINEAR_DISTANCE_CLAMPED 0xD004
|
||||
#define AL_EXPONENT_DISTANCE 0xD005
|
||||
#define AL_EXPONENT_DISTANCE_CLAMPED 0xD006
|
||||
|
||||
/*
|
||||
* Renderer State management
|
||||
*/
|
||||
AL_API void AL_APIENTRY alEnable( ALenum capability );
|
||||
|
||||
AL_API void AL_APIENTRY alDisable( ALenum capability );
|
||||
|
||||
AL_API ALboolean AL_APIENTRY alIsEnabled( ALenum capability );
|
||||
|
||||
|
||||
/*
|
||||
* State retrieval
|
||||
*/
|
||||
AL_API const ALchar* AL_APIENTRY alGetString( ALenum param );
|
||||
|
||||
AL_API void AL_APIENTRY alGetBooleanv( ALenum param, ALboolean* data );
|
||||
|
||||
AL_API void AL_APIENTRY alGetIntegerv( ALenum param, ALint* data );
|
||||
|
||||
AL_API void AL_APIENTRY alGetFloatv( ALenum param, ALfloat* data );
|
||||
|
||||
AL_API void AL_APIENTRY alGetDoublev( ALenum param, ALdouble* data );
|
||||
|
||||
AL_API ALboolean AL_APIENTRY alGetBoolean( ALenum param );
|
||||
|
||||
AL_API ALint AL_APIENTRY alGetInteger( ALenum param );
|
||||
|
||||
AL_API ALfloat AL_APIENTRY alGetFloat( ALenum param );
|
||||
|
||||
AL_API ALdouble AL_APIENTRY alGetDouble( ALenum param );
|
||||
|
||||
|
||||
/*
|
||||
* Error support.
|
||||
* Obtain the most recent error generated in the AL state machine.
|
||||
*/
|
||||
AL_API ALenum AL_APIENTRY alGetError( void );
|
||||
|
||||
|
||||
/*
|
||||
* Extension support.
|
||||
* Query for the presence of an extension, and obtain any appropriate
|
||||
* function pointers and enum values.
|
||||
*/
|
||||
AL_API ALboolean AL_APIENTRY alIsExtensionPresent( const ALchar* extname );
|
||||
|
||||
AL_API void* AL_APIENTRY alGetProcAddress( const ALchar* fname );
|
||||
|
||||
AL_API ALenum AL_APIENTRY alGetEnumValue( const ALchar* ename );
|
||||
|
||||
|
||||
/*
|
||||
* LISTENER
|
||||
* Listener represents the location and orientation of the
|
||||
* 'user' in 3D-space.
|
||||
*
|
||||
* Properties include: -
|
||||
*
|
||||
* Gain AL_GAIN ALfloat
|
||||
* Position AL_POSITION ALfloat[3]
|
||||
* Velocity AL_VELOCITY ALfloat[3]
|
||||
* Orientation AL_ORIENTATION ALfloat[6] (Forward then Up vectors)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Set Listener parameters
|
||||
*/
|
||||
AL_API void AL_APIENTRY alListenerf( ALenum param, ALfloat value );
|
||||
|
||||
AL_API void AL_APIENTRY alListener3f( ALenum param, ALfloat value1, ALfloat value2, ALfloat value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alListenerfv( ALenum param, const ALfloat* values );
|
||||
|
||||
AL_API void AL_APIENTRY alListeneri( ALenum param, ALint value );
|
||||
|
||||
AL_API void AL_APIENTRY alListener3i( ALenum param, ALint value1, ALint value2, ALint value3 );
|
||||
|
||||
AL_API void AL_APIENTRY alListeneriv( ALenum param, const ALint* values );
|
||||
|
||||