Linking OpenAL.

This commit is contained in:
Stiffly
2015-09-14 14:45:44 +02:00
parent 49a2100d4e
commit ed5881ec54
15 changed files with 2529 additions and 6 deletions
+7 -2
View File
@@ -8,6 +8,9 @@ find_package(assimp REQUIRED)
find_package(ZLIB REQUIRED)
find_package(PNG REQUIRED)
find_package(BGFX REQUIRED)
find_package(OpenAL REQUIRED)
# GLM
if(UNIX)
find_package(X11 REQUIRED)
@@ -24,6 +27,7 @@ include_directories(
${PNG_INCLUDE_DIRS}
${X11_INCLUDE_DIRS}
${BGFX_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
)
file(GLOB SOURCE_FILES_Core
@@ -71,10 +75,9 @@ set(SOURCE_FILES
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
set(STATIC_LIBRARY_FLAGS "${STATIC_LIBRARY_FLAGS}")
endif()
add_definitions(-DBGFX_CONFIG_RENDERER_OPENGL=33)
add_library(game ${SOURCE_FILES})
target_link_libraries(game
${OPENGL_LIBRARIES}
@@ -85,6 +88,7 @@ target_link_libraries(game
${PNG_LIBRARIES}
${X11_LIBRARIES}
${BGFX_LIBRARIES}
${OPENAL_LIBRARY}
)
add_executable(breakout
@@ -100,5 +104,6 @@ target_link_libraries(breakout
${PNG_LIBRARIES}
${X11_LIBRARIES}
${BGFX_LIBRARIES}
${OPENAL_LIBRARY}
)
+13 -1
View File
@@ -18,6 +18,18 @@ bool dd::Systems::Sound::OnKeyDown(const dd::Events::KeyDown &event)
{
// #define GLFW_KEY_S 83
if(event.KeyCode == 83){
HelloWorld();
//HelloWorld();
//Init openAL------------------
ALCdevice* device; alcOpenDevice(NULL);
ALCcontext* context;
if(device){
context = alcCreateContext(device, NULL);
alcMakeContextCurrent(context);
}
else{
LOG_ERROR("OpenAL failed to initialize");
}
}
}