mirror of https://github.com/mosra/magnum.git
408 changed files with 19325 additions and 3202 deletions
@ -0,0 +1,137 @@
|
||||
#.rst: |
||||
# FindOpenAL |
||||
# ---------- |
||||
# |
||||
# |
||||
# |
||||
# Locate OpenAL This module defines OPENAL_LIBRARY OPENAL_FOUND, if |
||||
# false, do not try to link to OpenAL OPENAL_INCLUDE_DIR, where to find |
||||
# the headers |
||||
# |
||||
# $OPENALDIR is an environment variable that would correspond to the |
||||
# ./configure --prefix=$OPENALDIR used in building OpenAL. |
||||
# |
||||
# Created by Eric Wing. This was influenced by the FindSDL.cmake |
||||
# module. |
||||
|
||||
#============================================================================= |
||||
# CMake - Cross Platform Makefile Generator |
||||
# Copyright 2000-2016 Kitware, Inc. |
||||
# Copyright 2000-2011 Insight Software Consortium |
||||
# All rights reserved. |
||||
# |
||||
# Redistribution and use in source and binary forms, with or without |
||||
# modification, are permitted provided that the following conditions |
||||
# are met: |
||||
# |
||||
# * Redistributions of source code must retain the above copyright |
||||
# notice, this list of conditions and the following disclaimer. |
||||
# |
||||
# * Redistributions in binary form must reproduce the above copyright |
||||
# notice, this list of conditions and the following disclaimer in the |
||||
# documentation and/or other materials provided with the distribution. |
||||
# |
||||
# * Neither the names of Kitware, Inc., the Insight Software Consortium, |
||||
# nor the names of their contributors may be used to endorse or promote |
||||
# products derived from this software without specific prior written |
||||
# permission. |
||||
# |
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
||||
# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
#============================================================================= |
||||
|
||||
# This makes the presumption that you are include al.h like |
||||
# #include "al.h" |
||||
# and not |
||||
# #include <AL/al.h> |
||||
# The reason for this is that the latter is not entirely portable. |
||||
# Windows/Creative Labs does not by default put their headers in AL/ and |
||||
# OS X uses the convention <OpenAL/al.h>. |
||||
# |
||||
# For Windows, Creative Labs seems to have added a registry key for their |
||||
# OpenAL 1.1 installer. I have added that key to the list of search paths, |
||||
# however, the key looks like it could be a little fragile depending on |
||||
# if they decide to change the 1.00.0000 number for bug fix releases. |
||||
# Also, they seem to have laid down groundwork for multiple library platforms |
||||
# which puts the library in an extra subdirectory. Currently there is only |
||||
# Win32 and I have hardcoded that here. This may need to be adjusted as |
||||
# platforms are introduced. |
||||
# The OpenAL 1.0 installer doesn't seem to have a useful key I can use. |
||||
# I do not know if the Nvidia OpenAL SDK has a registry key. |
||||
# |
||||
# For OS X, remember that OpenAL was added by Apple in 10.4 (Tiger). |
||||
# To support the framework, I originally wrote special framework detection |
||||
# code in this module which I have now removed with CMake's introduction |
||||
# of native support for frameworks. |
||||
# In addition, OpenAL is open source, and it is possible to compile on Panther. |
||||
# Furthermore, due to bugs in the initial OpenAL release, and the |
||||
# transition to OpenAL 1.1, it is common to need to override the built-in |
||||
# framework. |
||||
# Per my request, CMake should search for frameworks first in |
||||
# the following order: |
||||
# ~/Library/Frameworks/OpenAL.framework/Headers |
||||
# /Library/Frameworks/OpenAL.framework/Headers |
||||
# /System/Library/Frameworks/OpenAL.framework/Headers |
||||
# |
||||
# On OS X, this will prefer the Framework version (if found) over others. |
||||
# People will have to manually change the cache values of |
||||
# OPENAL_LIBRARY to override this selection or set the CMake environment |
||||
# CMAKE_INCLUDE_PATH to modify the search paths. |
||||
|
||||
find_path(OPENAL_INCLUDE_DIR al.h |
||||
HINTS |
||||
ENV OPENALDIR |
||||
# The AL was added in order to make the module working for Emscripten on OSX. |
||||
# Not sure why include/AL wasn't enough. |
||||
PATH_SUFFIXES include/AL include/OpenAL include AL |
||||
PATHS |
||||
~/Library/Frameworks |
||||
/Library/Frameworks |
||||
/sw # Fink |
||||
/opt/local # DarwinPorts |
||||
/opt/csw # Blastwave |
||||
/opt |
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] |
||||
) |
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8) |
||||
set(_OpenAL_ARCH_DIR libs/Win64) |
||||
else() |
||||
set(_OpenAL_ARCH_DIR libs/Win32) |
||||
endif() |
||||
|
||||
if(NOT CORRADE_TARGET_EMSCRIPTEN) |
||||
find_library(OPENAL_LIBRARY |
||||
NAMES OpenAL al openal OpenAL32 |
||||
HINTS |
||||
ENV OPENALDIR |
||||
PATH_SUFFIXES lib64 lib libs64 libs ${_OpenAL_ARCH_DIR} |
||||
PATHS |
||||
~/Library/Frameworks |
||||
/Library/Frameworks |
||||
/sw |
||||
/opt/local |
||||
/opt/csw |
||||
/opt |
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Creative\ Labs\\OpenAL\ 1.1\ Software\ Development\ Kit\\1.00.0000;InstallDir] |
||||
) |
||||
set(OPENAL_LIBRARY_NEEDED OPENAL_LIBRARY) |
||||
endif() |
||||
|
||||
unset(_OpenAL_ARCH_DIR) |
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND to TRUE if |
||||
# all listed variables are TRUE |
||||
include(FindPackageHandleStandardArgs) |
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenAL DEFAULT_MSG ${OPENAL_LIBRARY_NEEDED} OPENAL_INCLUDE_DIR) |
||||
|
||||
mark_as_advanced(OPENAL_LIBRARY OPENAL_INCLUDE_DIR) |
||||
@ -0,0 +1,48 @@
|
||||
call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x64 || exit /b |
||||
set PATH=%APPVEYOR_BUILD_FOLDER%/openal/bin/Win64;%APPVEYOR_BUILD_FOLDER%\deps\bin;%PATH% |
||||
|
||||
rem Build Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git || exit /b |
||||
cd corrade || exit /b |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Debug ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DWITH_INTERCONNECT=OFF ^ |
||||
-G Ninja || exit /b |
||||
cmake --build . || exit /b |
||||
cmake --build . --target install || exit /b |
||||
cd .. && cd .. |
||||
|
||||
rem Build |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Debug ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DCMAKE_PREFIX_PATH="%APPVEYOR_BUILD_FOLDER%/openal" ^ |
||||
-DTARGET_GLES=ON ^ |
||||
-DTARGET_GLES2=%TARGET_GLES2% ^ |
||||
-DTARGET_DESKTOP_GLES=ON ^ |
||||
-DWITH_AUDIO=ON ^ |
||||
-DWITH_SDL2APPLICATION=OFF ^ |
||||
-DWITH_WINDOWLESSWGLAPPLICATION=ON ^ |
||||
-DWITH_WGLCONTEXT=ON ^ |
||||
-DWITH_MAGNUMFONT=ON ^ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON ^ |
||||
-DWITH_OBJIMPORTER=ON ^ |
||||
-DWITH_TGAIMAGECONVERTER=ON ^ |
||||
-DWITH_TGAIMPORTER=ON ^ |
||||
-DWITH_WAVAUDIOIMPORTER=ON ^ |
||||
-DWITH_DISTANCEFIELDCONVERTER=OFF ^ |
||||
-DWITH_FONTCONVERTER=OFF ^ |
||||
-DWITH_IMAGECONVERTER=ON ^ |
||||
-DWITH_MAGNUMINFO=ON ^ |
||||
-DWITH_AL_INFO=ON ^ |
||||
-DBUILD_TESTS=ON ^ |
||||
-DBUILD_GL_TESTS=ON ^ |
||||
-G Ninja || exit /b |
||||
cmake --build . || exit /b |
||||
cmake --build . --target install || exit /b |
||||
|
||||
rem Test |
||||
ctest -V -E GLTest || exit /b |
||||
@ -0,0 +1,46 @@
|
||||
rem Workaround for CMake not wanting sh.exe on PATH for MinGW. AARGH. |
||||
set PATH=%PATH:C:\Program Files\Git\usr\bin;=% |
||||
set PATH=C:\tools\mingw64\bin;%APPVEYOR_BUILD_FOLDER%/openal/bin/Win64;%APPVEYOR_BUILD_FOLDER%\deps\bin;%PATH% |
||||
|
||||
rem Build Corrade. Could not get Ninja to work, meh. |
||||
git clone --depth 1 git://github.com/mosra/corrade.git || exit /b |
||||
cd corrade || exit /b |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Release ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DWITH_INTERCONNECT=OFF ^ |
||||
-G "MinGW Makefiles" || exit /b |
||||
cmake --build . -- -j || exit /b |
||||
cmake --build . --target install -- -j || exit /b |
||||
cd .. && cd .. |
||||
|
||||
rem Build |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Release ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DCMAKE_PREFIX_PATH="%APPVEYOR_BUILD_FOLDER%/SDL;%APPVEYOR_BUILD_FOLDER%/openal" ^ |
||||
-DWITH_AUDIO=ON ^ |
||||
-DWITH_SDL2APPLICATION=ON ^ |
||||
-DWITH_WINDOWLESSWGLAPPLICATION=ON ^ |
||||
-DWITH_WGLCONTEXT=ON ^ |
||||
-DWITH_MAGNUMFONT=ON ^ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON ^ |
||||
-DWITH_OBJIMPORTER=ON ^ |
||||
-DWITH_TGAIMAGECONVERTER=ON ^ |
||||
-DWITH_TGAIMPORTER=ON ^ |
||||
-DWITH_WAVAUDIOIMPORTER=ON ^ |
||||
-DWITH_DISTANCEFIELDCONVERTER=ON ^ |
||||
-DWITH_FONTCONVERTER=ON ^ |
||||
-DWITH_IMAGECONVERTER=ON ^ |
||||
-DWITH_MAGNUMINFO=ON ^ |
||||
-DWITH_AL_INFO=ON ^ |
||||
-DBUILD_TESTS=ON ^ |
||||
-DBUILD_GL_TESTS=ON ^ |
||||
-G "MinGW Makefiles" || exit /b |
||||
cmake --build . -- -j || exit /b |
||||
cmake --build . --target install -- -j || exit /b |
||||
|
||||
rem Test |
||||
ctest -V -E GLTest || exit /b |
||||
@ -0,0 +1,45 @@
|
||||
call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x64 || exit /b |
||||
set PATH=%APPVEYOR_BUILD_FOLDER%/openal/bin/Win64;%APPVEYOR_BUILD_FOLDER%\deps\bin;%PATH% |
||||
|
||||
rem Build Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git || exit /b |
||||
cd corrade || exit /b |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Debug ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DWITH_INTERCONNECT=OFF ^ |
||||
-G Ninja || exit /b |
||||
cmake --build . || exit /b |
||||
cmake --build . --target install || exit /b |
||||
cd .. && cd .. |
||||
|
||||
rem Build |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Debug ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DCMAKE_PREFIX_PATH="%APPVEYOR_BUILD_FOLDER%/SDL;%APPVEYOR_BUILD_FOLDER%/openal" ^ |
||||
-DWITH_AUDIO=ON ^ |
||||
-DWITH_SDL2APPLICATION=ON ^ |
||||
-DWITH_WINDOWLESSWGLAPPLICATION=ON ^ |
||||
-DWITH_WGLCONTEXT=ON ^ |
||||
-DWITH_MAGNUMFONT=ON ^ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON ^ |
||||
-DWITH_OBJIMPORTER=ON ^ |
||||
-DWITH_TGAIMAGECONVERTER=ON ^ |
||||
-DWITH_TGAIMPORTER=ON ^ |
||||
-DWITH_WAVAUDIOIMPORTER=ON ^ |
||||
-DWITH_DISTANCEFIELDCONVERTER=ON ^ |
||||
-DWITH_FONTCONVERTER=ON ^ |
||||
-DWITH_IMAGECONVERTER=ON ^ |
||||
-DWITH_MAGNUMINFO=ON ^ |
||||
-DWITH_AL_INFO=ON ^ |
||||
-DBUILD_TESTS=ON ^ |
||||
-DBUILD_GL_TESTS=ON ^ |
||||
-G Ninja || exit /b |
||||
cmake --build . || exit /b |
||||
cmake --build . --target install || exit /b |
||||
|
||||
rem Test |
||||
ctest -V -E GLTest || exit /b |
||||
@ -0,0 +1,76 @@
|
||||
call "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/vcvarsall.bat" x64 || exit /b |
||||
set PATH=%APPVEYOR_BUILD_FOLDER%\deps-native\bin;%PATH% |
||||
|
||||
rem Build ANGLE |
||||
git clone --depth 1 git://github.com/MSOpenTech/angle.git || exit /b |
||||
cd angle\winrt\10\src || exit /b |
||||
msbuild angle.sln /p:Configuration=Release || exit /b |
||||
cd ..\..\..\.. || exit /b |
||||
|
||||
rem Build SDL |
||||
appveyor DownloadFile https://www.libsdl.org/release/SDL2-2.0.4.zip || exit /b |
||||
7z x SDL2-2.0.4.zip || exit /b |
||||
ren SDL2-2.0.4 SDL || exit /b |
||||
cd SDL/VisualC-WinRT/UWP_VS2015 || exit/b |
||||
msbuild /p:Configuration=Release || exit /b |
||||
cd ..\..\.. |
||||
|
||||
git clone --depth 1 git://github.com/mosra/corrade.git || exit /b |
||||
cd corrade || exit /b |
||||
|
||||
rem Build native corrade-rc |
||||
mkdir build && cd build || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_BUILD_TYPE=Release ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps-native ^ |
||||
-DWITH_INTERCONNECT=OFF ^ |
||||
-DWITH_PLUGINMANAGER=OFF ^ |
||||
-DWITH_TESTSUITE=OFF ^ |
||||
-G Ninja || exit /b |
||||
cmake --build . --target install || exit /b |
||||
cd .. || exit /b |
||||
|
||||
rem Crosscompile Corrade |
||||
mkdir build-rt && cd build-rt || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_SYSTEM_NAME=WindowsStore ^ |
||||
-DCMAKE_SYSTEM_VERSION=10.0 ^ |
||||
-DCORRADE_RC_EXECUTABLE=%APPVEYOR_BUILD_FOLDER%/deps-native/bin/corrade-rc.exe ^ |
||||
-DCMAKE_INSTALL_PREFIX=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DWITH_INTERCONNECT=OFF ^ |
||||
-DBUILD_STATIC=ON ^ |
||||
-G "Visual Studio 14 2015" -A x64 || exit /b |
||||
cmake --build . --config Release --target install -- /m /v:m || exit /b |
||||
cd .. || exit /b |
||||
|
||||
cd .. || exit /b |
||||
|
||||
rem Crosscompile |
||||
mkdir build-rt && cd build-rt || exit /b |
||||
cmake .. ^ |
||||
-DCMAKE_SYSTEM_NAME=WindowsStore ^ |
||||
-DCMAKE_SYSTEM_VERSION=10.0 ^ |
||||
-DCORRADE_RC_EXECUTABLE=%APPVEYOR_BUILD_FOLDER%/deps-native/bin/corrade-rc.exe ^ |
||||
-DCMAKE_PREFIX_PATH=%APPVEYOR_BUILD_FOLDER%/deps ^ |
||||
-DEGL_LIBRARY=%APPVEYOR_BUILD_FOLDER%/angle/winrt/10/src/Release_x64/lib/libEGL.lib ^ |
||||
-DEGL_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/angle/include ^ |
||||
-DOPENGLES2_LIBRARY=%APPVEYOR_BUILD_FOLDER%/angle/winrt/10/src/Release_x64/lib/libGLESv2.lib ^ |
||||
-DOPENGLES2_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/angle/include ^ |
||||
-DOPENGLES3_LIBRARY=%APPVEYOR_BUILD_FOLDER%/angle/winrt/10/src/Release_x64/lib/libGLESv2.lib ^ |
||||
-DOPENGLES3_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/angle/include ^ |
||||
-DSDL2_LIBRARY=%APPVEYOR_BUILD_FOLDER%/SDL/VisualC-WinRT/UWP_VS2015/X64/Release/SDL-UWP/SDL2.lib ^ |
||||
-DSDL2_INCLUDE_DIR=%APPVEYOR_BUILD_FOLDER%/SDL/include ^ |
||||
-DWITH_AUDIO=OFF ^ |
||||
-DWITH_SDL2APPLICATION=ON ^ |
||||
-DWITH_MAGNUMFONT=ON ^ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON ^ |
||||
-DWITH_OBJIMPORTER=ON ^ |
||||
-DWITH_TGAIMAGECONVERTER=ON ^ |
||||
-DWITH_TGAIMPORTER=ON ^ |
||||
-DWITH_WAVAUDIOIMPORTER=OFF ^ |
||||
-DTARGET_GLES2=%TARGET_GLES2% ^ |
||||
-DBUILD_TESTS=ON ^ |
||||
-DBUILD_STATIC=ON ^ |
||||
-DBUILD_PLUGINS_STATIC=ON ^ |
||||
-G "Visual Studio 14 2015" -A x64 || exit /b |
||||
cmake --build . --config Release -- /m /v:m || exit /b |
||||
@ -0,0 +1,60 @@
|
||||
#!/bin/bash |
||||
set -ev |
||||
|
||||
git submodule update --init |
||||
|
||||
# Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git |
||||
cd corrade |
||||
|
||||
# Build native corrade-rc |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps-native \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps-native/lib \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DWITH_INTERCONNECT=OFF \ |
||||
-DWITH_PLUGINMANAGER=OFF \ |
||||
-DWITH_TESTSUITE=OFF |
||||
make -j install |
||||
cd .. |
||||
|
||||
# Crosscompile Corrade |
||||
mkdir build-android-arm && cd build-android-arm |
||||
ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r10e cmake .. \ |
||||
-DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/Android-ARM.cmake \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DWITH_INTERCONNECT=OFF |
||||
make -j install |
||||
cd .. |
||||
|
||||
cd .. |
||||
|
||||
# Crosscompile |
||||
mkdir build-android-arm && cd build-android-arm |
||||
ANDROID_NDK=$TRAVIS_BUILD_DIR/android-ndk-r10e cmake .. \ |
||||
-DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/Android-ARM.cmake \ |
||||
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ |
||||
-DCMAKE_PREFIX_PATH=$HOME/deps \ |
||||
-DCMAKE_FIND_ROOT_PATH=$HOME/deps \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DTARGET_GLES2=$TARGET_GLES2 \ |
||||
-DWITH_AUDIO=OFF \ |
||||
-DWITH_ANDROIDAPPLICATION=ON \ |
||||
-DWITH_EGLCONTEXT=ON \ |
||||
-DWITH_MAGNUMFONT=ON \ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON \ |
||||
-DWITH_OBJIMPORTER=ON \ |
||||
-DWITH_TGAIMAGECONVERTER=ON \ |
||||
-DWITH_TGAIMPORTER=ON \ |
||||
-DWITH_WAVAUDIOIMPORTER=OFF \ |
||||
-DBUILD_TESTS=ON |
||||
make -j${JOBS_LIMIT} |
||||
|
||||
# Start simulator and run tests |
||||
echo no | android create avd --force -n test -t android-19 --abi armeabi-v7a |
||||
emulator -avd test -no-audio -no-window & |
||||
android-wait-for-emulator |
||||
CORRADE_TEST_COLOR=ON ctest -V |
||||
@ -0,0 +1,43 @@
|
||||
#!/bin/bash |
||||
set -ev |
||||
|
||||
# Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git |
||||
cd corrade |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps/lib \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DWITH_INTERCONNECT=OFF |
||||
make -j install |
||||
cd ../.. |
||||
|
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_CXX_FLAGS=$COVERAGE \ |
||||
-DCMAKE_PREFIX_PATH="$HOME/deps" \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DTARGET_GLES=ON \ |
||||
-DTARGET_GLES2=$TARGET_GLES2 \ |
||||
-DTARGET_DESKTOP_GLES=ON \ |
||||
-DWITH_AUDIO=ON \ |
||||
-DWITH_GLFWAPPLICATION=OFF \ |
||||
-DWITH_SDL2APPLICATION=OFF \ |
||||
-DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON \ |
||||
-DWITH_${PLATFORM_GL_API}CONTEXT=ON \ |
||||
-DWITH_MAGNUMFONT=ON \ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON \ |
||||
-DWITH_OBJIMPORTER=ON \ |
||||
-DWITH_TGAIMAGECONVERTER=ON \ |
||||
-DWITH_TGAIMPORTER=ON \ |
||||
-DWITH_WAVAUDIOIMPORTER=ON \ |
||||
-DWITH_DISTANCEFIELDCONVERTER=OFF \ |
||||
-DWITH_FONTCONVERTER=OFF \ |
||||
-DWITH_IMAGECONVERTER=ON \ |
||||
-DWITH_MAGNUMINFO=ON \ |
||||
-DWITH_AL_INFO=ON \ |
||||
-DBUILD_TESTS=ON \ |
||||
-DBUILD_GL_TESTS=ON |
||||
make -j${JOBS_LIMIT} |
||||
CORRADE_TEST_COLOR=ON ctest -V -E GLTest |
||||
@ -0,0 +1,40 @@
|
||||
#!/bin/bash |
||||
set -ev |
||||
|
||||
# Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git |
||||
cd corrade |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps/lib \ |
||||
-DCMAKE_BUILD_TYPE=Debug \ |
||||
-DWITH_INTERCONNECT=OFF |
||||
make -j install |
||||
cd ../.. |
||||
|
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_CXX_FLAGS=$COVERAGE \ |
||||
-DCMAKE_PREFIX_PATH="$HOME/deps;$HOME/sdl2;$HOME/glfw" \ |
||||
-DCMAKE_BUILD_TYPE=Debug \ |
||||
-DWITH_AUDIO=ON \ |
||||
-DWITH_GLFWAPPLICATION=ON \ |
||||
-DWITH_SDL2APPLICATION=ON \ |
||||
-DWITH_WINDOWLESS${PLATFORM_GL_API}APPLICATION=ON \ |
||||
-DWITH_${PLATFORM_GL_API}CONTEXT=ON \ |
||||
-DWITH_MAGNUMFONT=ON \ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON \ |
||||
-DWITH_OBJIMPORTER=ON \ |
||||
-DWITH_TGAIMAGECONVERTER=ON \ |
||||
-DWITH_TGAIMPORTER=ON \ |
||||
-DWITH_WAVAUDIOIMPORTER=ON \ |
||||
-DWITH_DISTANCEFIELDCONVERTER=ON \ |
||||
-DWITH_FONTCONVERTER=ON \ |
||||
-DWITH_IMAGECONVERTER=ON \ |
||||
-DWITH_MAGNUMINFO=ON \ |
||||
-DWITH_AL_INFO=ON \ |
||||
-DBUILD_TESTS=ON \ |
||||
-DBUILD_GL_TESTS=ON |
||||
make -j${JOBS_LIMIT} |
||||
CORRADE_TEST_COLOR=ON ctest -V -E GLTest |
||||
@ -0,0 +1,62 @@
|
||||
#!/bin/bash |
||||
set -ev |
||||
|
||||
git submodule update --init |
||||
|
||||
# Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git |
||||
cd corrade |
||||
|
||||
# Build native corrade-rc |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps-native \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps-native/lib \ |
||||
-DWITH_INTERCONNECT=OFF \ |
||||
-DWITH_PLUGINMANAGER=OFF \ |
||||
-DWITH_TESTSUITE=OFF |
||||
make -j install |
||||
cd .. |
||||
|
||||
# Crosscompile Corrade |
||||
mkdir build-emscripten && cd build-emscripten |
||||
cmake .. \ |
||||
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ |
||||
-DCMAKE_TOOLCHAIN_FILE="../../toolchains/generic/Emscripten.cmake" \ |
||||
-DEMSCRIPTEN_PREFIX=$(echo /usr/local/Cellar/emscripten/*/libexec) \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -O1" \ |
||||
-DCMAKE_EXE_LINKER_FLAGS_RELEASE="-O1" \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DWITH_INTERCONNECT=OFF |
||||
make -j install |
||||
cd .. |
||||
|
||||
cd .. |
||||
|
||||
# Crosscompile |
||||
mkdir build-emscripten && cd build-emscripten |
||||
cmake .. \ |
||||
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ |
||||
-DCMAKE_TOOLCHAIN_FILE="../toolchains/generic/Emscripten.cmake" \ |
||||
-DEMSCRIPTEN_PREFIX=$(echo /usr/local/Cellar/emscripten/*/libexec) \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DCMAKE_CXX_FLAGS_RELEASE="-DNDEBUG -O1" \ |
||||
-DCMAKE_EXE_LINKER_FLAGS_RELEASE="-O1" \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DCMAKE_FIND_ROOT_PATH=$HOME/deps \ |
||||
-DWITH_AUDIO=ON \ |
||||
-DWITH_SDL2APPLICATION=ON \ |
||||
-DWITH_MAGNUMFONT=ON \ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON \ |
||||
-DWITH_OBJIMPORTER=ON \ |
||||
-DWITH_TGAIMAGECONVERTER=ON \ |
||||
-DWITH_TGAIMPORTER=ON \ |
||||
-DWITH_WAVAUDIOIMPORTER=ON \ |
||||
-DBUILD_TESTS=ON \ |
||||
-DTARGET_GLES2=$TARGET_GLES2 |
||||
make -j4 |
||||
|
||||
# Test |
||||
CORRADE_TEST_COLOR=ON ctest -V -E ALTest |
||||
@ -0,0 +1,65 @@
|
||||
#!/bin/bash |
||||
set -ev |
||||
|
||||
git submodule update --init |
||||
|
||||
# Corrade |
||||
git clone --depth 1 git://github.com/mosra/corrade.git |
||||
cd corrade |
||||
|
||||
# Build native corrade-rc |
||||
mkdir build && cd build |
||||
cmake .. \ |
||||
-DCMAKE_BUILD_TYPE=Release \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps-native \ |
||||
-DCMAKE_INSTALL_RPATH=$HOME/deps-native/lib \ |
||||
-DWITH_INTERCONNECT=OFF \ |
||||
-DWITH_PLUGINMANAGER=OFF \ |
||||
-DWITH_TESTSUITE=OFF |
||||
make -j install |
||||
cd .. |
||||
|
||||
# Crosscompile Corrade |
||||
mkdir build-ios && cd build-ios |
||||
cmake .. \ |
||||
-DCMAKE_TOOLCHAIN_FILE=../../toolchains/generic/iOS.cmake \ |
||||
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \ |
||||
-DCMAKE_OSX_ARCHITECTURES="x86_64" \ |
||||
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ |
||||
-DCMAKE_INSTALL_PREFIX=$HOME/deps \ |
||||
-DBUILD_STATIC=ON \ |
||||
-DTESTSUITE_TARGET_XCTEST=ON \ |
||||
-DWITH_INTERCONNECT=OFF \ |
||||
-G Xcode |
||||
cmake --build . --config Release --target install | xcpretty |
||||
cd ../.. |
||||
|
||||
# Crosscompile Magnum |
||||
mkdir build-ios && cd build-ios |
||||
cmake .. \ |
||||
-DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \ |
||||
-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk \ |
||||
-DCMAKE_OSX_ARCHITECTURES="x86_64" \ |
||||
-DCORRADE_RC_EXECUTABLE=$HOME/deps-native/bin/corrade-rc \ |
||||
-DCMAKE_PREFIX_PATH="$HOME/deps;$TRAVIS_BUILD_DIR/sdl2" \ |
||||
-DTARGET_GLES2=$TARGET_GLES2 \ |
||||
-DWITH_AUDIO=ON \ |
||||
-DWITH_SDL2APPLICATION=ON \ |
||||
-DWITH_WINDOWLESSIOSAPPLICATION=ON \ |
||||
-DWITH_EGLCONTEXT=ON \ |
||||
-DWITH_MAGNUMFONT=ON \ |
||||
-DWITH_MAGNUMFONTCONVERTER=ON \ |
||||
-DWITH_OBJIMPORTER=ON \ |
||||
-DWITH_TGAIMAGECONVERTER=ON \ |
||||
-DWITH_TGAIMPORTER=ON \ |
||||
-DWITH_WAVAUDIOIMPORTER=ON \ |
||||
-DBUILD_STATIC=ON \ |
||||
-DBUILD_PLUGINS_STATIC=ON \ |
||||
-DBUILD_TESTS=ON \ |
||||
-DBUILD_GL_TESTS=ON \ |
||||
-G Xcode |
||||
cmake --build . --config Release | xcpretty |
||||
# TODO: find a better way to avoid |
||||
# Library not loaded: /System/Library/Frameworks/OpenGLES.framework/OpenGLES |
||||
# error |
||||
DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks/OpenGLES.framework/ DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/Frameworks CORRADE_TEST_COLOR=ON ctest -V -C Release -E GLTest |
||||
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
||||
<plist version="1.0"> |
||||
<dict> |
||||
<key>CFBundleDevelopmentRegion</key> |
||||
<string>en-US</string> |
||||
<key>CFBundleExecutable</key> |
||||
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string> |
||||
<key>CFBundleIdentifier</key> |
||||
<string>cz.mosra.magnum.magnum-al-info</string> |
||||
<key>CFBundleInfoDictionaryVersion</key> |
||||
<string>6.0</string> |
||||
<key>CFBundleName</key> |
||||
<string>magnum-al-info</string> |
||||
<key>CFBundlePackageType</key> |
||||
<string>APPL</string> |
||||
</dict> |
||||
</plist> |
||||
@ -0,0 +1,60 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
Copyright © 2015 Jonathan Hale <squareys@googlemail.com> |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a |
||||
copy of this software and associated documentation files (the "Software"), |
||||
to deal in the Software without restriction, including without limitation |
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
and/or sell copies of the Software, and to permit persons to whom the |
||||
Software is furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included |
||||
in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
DEALINGS IN THE SOFTWARE. |
||||
*/ |
||||
|
||||
#include <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Audio/Extensions.h" |
||||
#include "Magnum/Audio/Context.h" |
||||
|
||||
namespace Magnum { namespace Audio { namespace Test { |
||||
|
||||
struct ContextALTest: TestSuite::Tester { |
||||
explicit ContextALTest(); |
||||
|
||||
void extensionsString(); |
||||
void isExtensionEnabled(); |
||||
|
||||
Context _context; |
||||
}; |
||||
|
||||
ContextALTest::ContextALTest() { |
||||
addTests({&ContextALTest::extensionsString, |
||||
&ContextALTest::isExtensionEnabled}); |
||||
} |
||||
|
||||
void ContextALTest::extensionsString() { |
||||
std::vector<std::string> extensions = _context.extensionStrings(); |
||||
|
||||
CORRADE_VERIFY(!extensions.empty()); |
||||
} |
||||
|
||||
void ContextALTest::isExtensionEnabled() { |
||||
CORRADE_VERIFY(Context::current().isExtensionSupported<Extensions::ALC::EXT::ENUMERATION>()); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Audio::Test::ContextALTest) |
||||
@ -0,0 +1,110 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a |
||||
copy of this software and associated documentation files (the "Software"), |
||||
to deal in the Software without restriction, including without limitation |
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
and/or sell copies of the Software, and to permit persons to whom the |
||||
Software is furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included |
||||
in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
DEALINGS IN THE SOFTWARE. |
||||
*/ |
||||
|
||||
#include <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Audio/Context.h" |
||||
#include "Magnum/Audio/Renderer.h" |
||||
|
||||
namespace Magnum { namespace Audio { namespace Test { |
||||
|
||||
struct RendererALTest: TestSuite::Tester { |
||||
explicit RendererALTest(); |
||||
|
||||
void listenerOrientation(); |
||||
void listenerPosition(); |
||||
void listenerVelocity(); |
||||
void listenerGain(); |
||||
void speedOfSound(); |
||||
void dopplerFactor(); |
||||
void distanceModel(); |
||||
|
||||
Context _context; |
||||
}; |
||||
|
||||
RendererALTest::RendererALTest() { |
||||
addTests({&RendererALTest::listenerOrientation, |
||||
&RendererALTest::listenerPosition, |
||||
&RendererALTest::listenerVelocity, |
||||
&RendererALTest::listenerGain, |
||||
&RendererALTest::speedOfSound, |
||||
&RendererALTest::dopplerFactor, |
||||
&RendererALTest::distanceModel}); |
||||
} |
||||
|
||||
void RendererALTest::listenerOrientation() { |
||||
constexpr Vector3 up{1.0f, 2.0f, 3.0f}, fwd{3.0f, 2.0f, 1.0f}; |
||||
Renderer::setListenerOrientation(fwd, up); |
||||
std::array<Vector3, 2> orientation = Renderer::listenerOrientation(); |
||||
|
||||
CORRADE_COMPARE(orientation[0], fwd); |
||||
CORRADE_COMPARE(orientation[1], up); |
||||
} |
||||
|
||||
void RendererALTest::listenerPosition() { |
||||
constexpr Vector3 pos{1.0f, 3.0f, 2.0f}; |
||||
Renderer::setListenerPosition(pos); |
||||
|
||||
CORRADE_COMPARE(Renderer::listenerPosition(), pos); |
||||
} |
||||
|
||||
void RendererALTest::listenerVelocity() { |
||||
constexpr Vector3 vel{1.0f, 3.0f, 2.0f}; |
||||
Renderer::setListenerVelocity(vel); |
||||
|
||||
CORRADE_COMPARE(Renderer::listenerVelocity(), vel); |
||||
} |
||||
|
||||
void RendererALTest::listenerGain() { |
||||
constexpr Float gain = 0.512f; |
||||
Renderer::setListenerGain(gain); |
||||
|
||||
CORRADE_COMPARE(Renderer::listenerGain(), gain); |
||||
} |
||||
|
||||
void RendererALTest::speedOfSound() { |
||||
constexpr Float speed = 1.25f; |
||||
Renderer::setSpeedOfSound(speed); |
||||
|
||||
CORRADE_COMPARE(Renderer::speedOfSound(), speed); |
||||
} |
||||
|
||||
void RendererALTest::dopplerFactor() { |
||||
constexpr Float factor = 0.3335f; |
||||
Renderer::setDopplerFactor(factor); |
||||
|
||||
CORRADE_COMPARE(Renderer::dopplerFactor(), factor); |
||||
} |
||||
|
||||
void RendererALTest::distanceModel() { |
||||
constexpr Renderer::DistanceModel model = Renderer::DistanceModel::InverseClamped; |
||||
Renderer::setDistanceModel(model); |
||||
|
||||
CORRADE_COMPARE(Renderer::distanceModel(), model); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Audio::Test::RendererALTest) |
||||
@ -0,0 +1,173 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a |
||||
copy of this software and associated documentation files (the "Software"), |
||||
to deal in the Software without restriction, including without limitation |
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
and/or sell copies of the Software, and to permit persons to whom the |
||||
Software is furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included |
||||
in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
DEALINGS IN THE SOFTWARE. |
||||
*/ |
||||
|
||||
#include <Corrade/TestSuite/Tester.h> |
||||
|
||||
#include "Magnum/Audio/Context.h" |
||||
#include "Magnum/Audio/Source.h" |
||||
|
||||
namespace Magnum { namespace Audio { namespace Test { |
||||
|
||||
struct SourceALTest: TestSuite::Tester { |
||||
explicit SourceALTest(); |
||||
|
||||
void construct(); |
||||
|
||||
void position(); |
||||
void direction(); |
||||
void velocity(); |
||||
void gain(); |
||||
void looping(); |
||||
void relative(); |
||||
void maxDistance(); |
||||
void maxGain(); |
||||
void minGain(); |
||||
void coneAnglesAndGain(); |
||||
void rolloffFactor(); |
||||
|
||||
Context _context; |
||||
}; |
||||
|
||||
SourceALTest::SourceALTest() { |
||||
addTests({&SourceALTest::construct, |
||||
|
||||
&SourceALTest::position, |
||||
&SourceALTest::direction, |
||||
&SourceALTest::velocity, |
||||
&SourceALTest::gain, |
||||
&SourceALTest::looping, |
||||
&SourceALTest::relative, |
||||
&SourceALTest::maxDistance, |
||||
&SourceALTest::maxGain, |
||||
&SourceALTest::minGain, |
||||
&SourceALTest::coneAnglesAndGain, |
||||
&SourceALTest::rolloffFactor}); |
||||
} |
||||
|
||||
void SourceALTest::construct() { |
||||
Source source; |
||||
CORRADE_VERIFY(source.id() != 0); |
||||
} |
||||
|
||||
void SourceALTest::position() { |
||||
Source source; |
||||
constexpr Vector3 pos{3.0f, 5.0f, 6.0f}; |
||||
source.setPosition(pos); |
||||
|
||||
CORRADE_COMPARE(source.position(), pos); |
||||
} |
||||
|
||||
void SourceALTest::direction() { |
||||
Source source; |
||||
constexpr Vector3 dir{3.0f, 1.0f, 2.0f}; |
||||
source.setDirection(dir); |
||||
|
||||
CORRADE_COMPARE(source.direction(), dir); |
||||
} |
||||
|
||||
void SourceALTest::velocity() { |
||||
Source source; |
||||
constexpr Vector3 vel{-3.0f, 5.0f, -6.0f}; |
||||
source.setVelocity(vel); |
||||
|
||||
CORRADE_COMPARE(source.velocity(), vel); |
||||
} |
||||
|
||||
void SourceALTest::gain() { |
||||
Source source; |
||||
constexpr Float gain = 0.1234f; |
||||
source.setGain(gain); |
||||
|
||||
CORRADE_COMPARE(source.gain(), gain); |
||||
} |
||||
|
||||
void SourceALTest::looping() { |
||||
Source source; |
||||
source.setLooping(true); |
||||
CORRADE_VERIFY(source.isLooping()); |
||||
source.setLooping(false); |
||||
CORRADE_VERIFY(!source.isLooping()); |
||||
} |
||||
|
||||
void SourceALTest::relative() { |
||||
Source source; |
||||
source.setRelative(true); |
||||
CORRADE_VERIFY(source.isRelative()); |
||||
source.setRelative(false); |
||||
CORRADE_VERIFY(!source.isRelative()); |
||||
} |
||||
|
||||
void SourceALTest::maxDistance() { |
||||
Source source; |
||||
constexpr Float dist = 0.222f; |
||||
source.setMaxDistance(dist); |
||||
|
||||
CORRADE_COMPARE(source.maxDistance(), dist); |
||||
} |
||||
|
||||
void SourceALTest::maxGain() { |
||||
Source source; |
||||
constexpr Float gain = 0.3131f; |
||||
source.setMaxGain(gain); |
||||
|
||||
CORRADE_COMPARE(source.maxGain(), gain); |
||||
} |
||||
|
||||
void SourceALTest::minGain() { |
||||
Source source; |
||||
constexpr Float gain = 0.4144f; |
||||
source.setMinGain(gain); |
||||
|
||||
CORRADE_COMPARE(source.minGain(), gain); |
||||
} |
||||
|
||||
void SourceALTest::coneAnglesAndGain() { |
||||
using namespace Math::Literals; |
||||
|
||||
Source source; |
||||
constexpr auto outerAngle = 12.0_degf; |
||||
constexpr auto innerAngle = 21.0_degf; |
||||
constexpr Float outerGain = 0.05f; |
||||
|
||||
source.setInnerConeAngle(innerAngle); |
||||
source.setOuterConeAngle(outerAngle); |
||||
source.setOuterConeGain(outerGain); |
||||
|
||||
CORRADE_COMPARE(source.outerConeAngle(), outerAngle); |
||||
CORRADE_COMPARE(source.innerConeAngle(), innerAngle); |
||||
CORRADE_COMPARE(source.outerConeGain(), outerGain); |
||||
} |
||||
|
||||
void SourceALTest::rolloffFactor() { |
||||
Source source; |
||||
constexpr Float fact = 42.0f; |
||||
source.setRolloffFactor(fact); |
||||
|
||||
CORRADE_COMPARE(source.rolloffFactor(), fact); |
||||
} |
||||
|
||||
}}} |
||||
|
||||
CORRADE_TEST_MAIN(Magnum::Audio::Test::SourceALTest) |
||||
@ -0,0 +1,112 @@
|
||||
/*
|
||||
This file is part of Magnum. |
||||
|
||||
Copyright © 2010, 2011, 2012, 2013, 2014, 2015, 2016 |
||||
Vladimír Vondruš <mosra@centrum.cz> |
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a |
||||
copy of this software and associated documentation files (the "Software"), |
||||
to deal in the Software without restriction, including without limitation |
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense, |
||||
and/or sell copies of the Software, and to permit persons to whom the |
||||
Software is furnished to do so, subject to the following conditions: |
||||
|
||||
The above copyright notice and this permission notice shall be included |
||||
in all copies or substantial portions of the Software. |
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
||||
DEALINGS IN THE SOFTWARE. |
||||
*/ |
||||
|
||||
#include <Corrade/Utility/Arguments.h> |
||||
|
||||
#include "Magnum/Magnum.h" |
||||
#include "Magnum/Audio/Context.h" |
||||
|
||||
namespace Magnum { |
||||
|
||||
/** @page magnum-al-info Magnum OpenAL Info
|
||||
@brief Displays information about Magnum OpenAL capabilities |
||||
|
||||
@section magnum-al-info-usage Usage |
||||
|
||||
magnum-al-info [-h|--help] [-s|--short] [--extension-strings] |
||||
|
||||
Arguments: |
||||
- `-h`,` --help` -- display this help message and exit |
||||
- `-s`, `--short` -- display just essential info and exit |
||||
- `--extension-strings` -- list all extension strings provided by the driver |
||||
(implies `--short`) |
||||
|
||||
@section magnum-al-info-example Example output |
||||
|
||||
``` |
||||
+---------------------------------------------------------+ |
||||
| Information about Magnum engine and OpenAL capabilities | |
||||
+---------------------------------------------------------+ |
||||
|
||||
Audio Renderer: OpenAL Soft by OpenAL Community |
||||
OpenAL version: 1.1 ALSOFT 1.17.2 |
||||
Available devices: |
||||
OpenAL Soft |
||||
Current device: OpenAL Soft |
||||
Vendor extension support: |
||||
AL_EXT_FLOAT32 SUPPORTED |
||||
AL_EXT_DOUBLE SUPPORTED |
||||
AL_EXT_ALAW SUPPORTED |
||||
AL_EXT_MULAW SUPPORTED |
||||
AL_EXT_MCFORMATS SUPPORTED |
||||
ALC_ENUMERATION_EXT SUPPORTED |
||||
ALC_SOFTX_HRTF - |
||||
ALC_SOFT_HRTF SUPPORTED |
||||
|
||||
``` |
||||
|
||||
*/ |
||||
|
||||
} |
||||
|
||||
using namespace Magnum; |
||||
|
||||
int main(const int argc, const char** const argv) { |
||||
Utility::Arguments args; |
||||
args.addBooleanOption('s', "short").setHelp("short", "display just essential info and exit") |
||||
.addBooleanOption("extension-strings").setHelp("extension-strings", "list all extension strings provided by the driver (implies --short)") |
||||
.parse(argc, argv); |
||||
|
||||
Debug() << ""; |
||||
Debug() << " +---------------------------------------------------------+"; |
||||
Debug() << " | Information about Magnum engine and OpenAL capabilities |"; |
||||
Debug() << " +---------------------------------------------------------+"; |
||||
Debug() << ""; |
||||
|
||||
Audio::Context c; |
||||
Debug() << "Available devices:"; |
||||
for(const auto& device: Audio::Context::deviceSpecifierStrings()) |
||||
Debug() << " " << device; |
||||
Debug() << "Current device:" << c.deviceSpecifierString(); |
||||
|
||||
if(args.isSet("extension-strings")) { |
||||
Debug() << "Extension strings:" << Debug::newline |
||||
<< c.extensionStrings(); |
||||
return 0; |
||||
} |
||||
|
||||
if(args.isSet("short")) return 0; |
||||
|
||||
Debug() << "Vendor extension support:"; |
||||
for(const auto& extension: Audio::Extension::extensions()) { |
||||
std::string extensionName = extension.string(); |
||||
Debug d; |
||||
d << " " << extensionName << std::string(60-extensionName.size(), ' '); |
||||
if(c.isExtensionSupported(extension)) |
||||
d << "SUPPORTED"; |
||||
else |
||||
d << " -"; |
||||
} |
||||
} |
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue