Skip to content

Commit

Permalink
OpenAL On Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBrokenRail committed Jun 18, 2024
1 parent cdd0b29 commit 78b9dd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions platforms/sound/openal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ elseif(EMSCRIPTEN)
# Use Emscripten's OpenAL
target_link_libraries(reminecraftpe-sound PUBLIC openal)
else()
# Use System ZLib
find_library(OPENAL_LIBRARY NAMES openal REQUIRED)
# Use System OpenAL
find_package(OpenAL REQUIRED)
target_link_libraries(reminecraftpe-sound PUBLIC "${OPENAL_LIBRARY}")
target_include_directories(reminecraftpe-sound PUBLIC "${OPENAL_INCLUDE_DIR}")
endif()

# Headers
Expand Down
14 changes: 7 additions & 7 deletions platforms/sound/openal/CustomSoundSystem.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#pragma once

#ifdef _WIN32
#include <al.h>
#include <alc.h>
#pragma comment( lib, "OpenAl32.lib" )
#elif defined(__APPLE__)

#ifdef __APPLE__
#include <OpenAL/al.h>
#include <OpenAL/alc.h>
#else
#include <AL/al.h>
#include <AL/alc.h>
#include "al.h"
#include "alc.h"
#ifdef _WIN32
#pragma comment( lib, "OpenAL32.lib" )
#endif
#endif

#include <string>
Expand Down

0 comments on commit 78b9dd2

Please sign in to comment.