updated .gitattributes, configured CMake to properly handle SteamAudio DLL

This commit is contained in:
Nyx
2025-05-08 01:13:48 -06:00
parent 319795c4c9
commit 79bdb2254c
27 changed files with 660 additions and 254 deletions

View File

@@ -1,112 +1,70 @@
# Options are listed here:
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
--- ---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4 AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true AlignOperands: true
AlignTrailingComments: true AlignTrailingComments: false
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All AlwaysBreakTemplateDeclarations: Yes
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BitFieldColonSpacing: Both
BraceWrapping: BraceWrapping:
AfterCaseLabel: true AfterCaseLabel: false
AfterClass: true AfterClass: false
AfterControlStatement: true AfterControlStatement: false
AfterEnum: true AfterEnum: false
AfterFunction: true AfterFunction: false
AfterNamespace: true AfterNamespace: false
AfterStruct: true AfterStruct: false
AfterUnion: true AfterUnion: false
AfterExternBlock: true AfterExternBlock: false
BeforeCatch: true BeforeCatch: false
BeforeElse: true BeforeElse: false
IndentBraces: false BeforeLambdaBody: false
BeforeWhile: false
SplitEmptyFunction: true SplitEmptyFunction: true
SplitEmptyRecord: true SplitEmptyRecord: true
SplitEmptyNamespace: true SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon BreakConstructorInitializers: AfterColon
BreakStringLiterals: true BreakConstructorInitializersBeforeComma: false
ColumnLimit: 100 ColumnLimit: 120
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4 ContinuationIndentWidth: 8
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false Cpp11BracedListStyle: false
DeriveLineEnding: false DeriveLineEnding: false
DerivePointerAlignment: false
EmptyLineBeforeAccessModifier: LogicalBlock
EmptyLineAfterAccessModifier: Never
FixNamespaceComments: false FixNamespaceComments: false
IncludeBlocks: Preserve
IncludeCategories: IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/' - Regex: '^<.*'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1 Priority: 1
IncludeIsMainRegex: '(Test)?$' - Regex: '^".*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 4 IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: true InsertBraces: true
KeepEmptyLinesAtTheStartOfBlocks: true InsertNewlineAtEOF: true
Language: Cpp MacroBlockBegin: ''
MaxEmptyLinesToKeep: 1 MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All NamespaceIndentation: All
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 1000 PenaltyReturnTypeOnItsOwnLine: 1000
PointerAlignment: Right
ReflowComments: true
SortIncludes: true SortIncludes: true
SortUsingDeclarations: true SortUsingDeclarations: true
SpaceAfterCStyleCast: false SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: false
SpaceAfterTemplateKeyword: true SpaceBeforeRangeBasedForLoopColon: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false SpacesInAngles: false
SpacesInContainerLiterals: true SpacesInConditionalStatement: false
SpacesInCStyleCastParentheses: false SpacesInCStyleCastParentheses: false
SpacesInParentheses: true SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: c++17 Standard: c++17
TabWidth: 4 TabWidth: 4
UseCRLF: false UseCRLF: false
UseTab: Never ...

5
.gitattributes vendored Normal file
View File

@@ -0,0 +1,5 @@
*.jpg filter=lfs diff=lfs merge=lfs -text
*.so filter=lfs diff=lfs merge=lfs -text
*.dylib filter=lfs diff=lfs merge=lfs -text
*.a filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text

View File

@@ -1,164 +1,194 @@
# SPDX-License-Identifier: Unlicense # SPDX-License-Identifier: Unlicense
cmake_minimum_required( VERSION 3.22 ) cmake_minimum_required(VERSION 3.22)
message( STATUS "Using CMake ${CMAKE_VERSION}" ) # Opt into the new install-destination normalization behavior
if(POLICY CMP0177)
cmake_policy(SET CMP0177 NEW)
endif()
message(STATUS "Using CMake ${CMAKE_VERSION}")
# Require out-of-source builds # Require out-of-source builds
file( TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH ) file(TO_CMAKE_PATH "${PROJECT_BINARY_DIR}/CMakeLists.txt" LOC_PATH)
if(EXISTS "${LOC_PATH}")
if ( EXISTS "${LOC_PATH}" ) message(FATAL_ERROR "You cannot build in the source directory. Please use a build subdirectory.")
message( FATAL_ERROR "You cannot build in the source directory. Please use a build subdirectory." )
endif() endif()
# Add paths to modules # Add custom CMake modules
list( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" ) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
# Turn on link time optimization for everything # Enable LTO for release if supported
set( CMAKE_INTERPROCEDURAL_OPTIMIZATION_RELEASE ON ) include(CheckIPOSupported)
check_ipo_supported(RESULT ipo_supported OUTPUT ipo_output)
# Output compile commands to compile_commands.json (for debugging CMake issues) if(ipo_supported)
set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) message(STATUS "IPO/LTO supported: enabling interprocedural optimization")
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
# Build universal lib on macOS else()
# Note that CMAKE_OSX_ARCHITECTURES must be set before project(). message(STATUS "IPO/LTO not supported: skipping LTO flags (${ipo_output})")
if ( APPLE )
set( CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "" )
endif() endif()
# Main project information # Output compile commands for editor integration
project( SteamAudioGodot set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
LANGUAGES
CXX # Build universal library on macOS
VERSION if(APPLE)
0.1.0 set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
endif()
# Project definition
project(SteamAudioGodot
VERSION 0.1.0
LANGUAGES CXX
) )
# Create our library # Create the shared library target
add_library( ${PROJECT_NAME} SHARED ) add_library(${PROJECT_NAME} SHARED)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)
target_compile_features( ${PROJECT_NAME} # Determine architecture label
PRIVATE set(LIB_ARCH ${CMAKE_SYSTEM_PROCESSOR})
cxx_std_17 if(APPLE)
) set(LIB_ARCH "universal")
# LIB_ARCH is the architecture being built. It is set to the build system's architecture.
# For macOS, we build a universal library (both arm64 and x86_64).
set( LIB_ARCH ${CMAKE_SYSTEM_PROCESSOR} )
if ( APPLE )
set( LIB_ARCH "universal" )
endif() endif()
# LIB_DIR is where the actual library ends up. This is used in both the build directory and the # Where Godot expects library binaries
# install directory and needs to be consistent with the paths in the gdextension file. set(LIB_DIR "lib/${CMAKE_SYSTEM_NAME}-${LIB_ARCH}")
# e.g. linux.release.x86_64 = "lib/Linux-x86_64/libGDExtensionTemplate.so" message(STATUS "Building ${PROJECT_NAME} for ${LIB_ARCH} on ${CMAKE_SYSTEM_NAME}")
set( LIB_DIR "lib/${CMAKE_SYSTEM_NAME}-${LIB_ARCH}" )
message( STATUS "Building ${PROJECT_NAME} for ${LIB_ARCH} on ${CMAKE_SYSTEM_NAME}") # Output directories for built library
set(BUILD_OUTPUT_DIR "${PROJECT_BINARY_DIR}/${PROJECT_NAME}/")
# BUILD_OUTPUT_DIR is where we put the resulting library (in the build directory) set_target_properties(${PROJECT_NAME} PROPERTIES
set( BUILD_OUTPUT_DIR "${PROJECT_BINARY_DIR}/${PROJECT_NAME}/" )
set_target_properties( ${PROJECT_NAME}
PROPERTIES
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN true
RUNTIME_OUTPUT_DIRECTORY "${BUILD_OUTPUT_DIR}/${LIB_DIR}" RUNTIME_OUTPUT_DIRECTORY "${BUILD_OUTPUT_DIR}/${LIB_DIR}"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_DIR}/${LIB_DIR}" LIBRARY_OUTPUT_DIRECTORY "${BUILD_OUTPUT_DIR}/${LIB_DIR}"
CXX_VISIBILITY_PRESET hidden
VISIBILITY_INLINES_HIDDEN TRUE
) )
if( NOT DEFINED CMAKE_DEBUG_POSTFIX ) # Append debug postfix if needed
set_target_properties( ${PROJECT_NAME} if(NOT DEFINED CMAKE_DEBUG_POSTFIX)
PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX "-d")
DEBUG_POSTFIX "-d"
)
endif() endif()
# Copy over additional files from the support_files directory # (Optional) Copy support_files icons and templates next to build output
add_custom_command( # if you need them in your local addon for testing. Exclude the 'lib' folder to avoid nested structure.
TARGET ${PROJECT_NAME} POST_BUILD add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/support_files" "${CMAKE_SOURCE_DIR}/support_files/icons"
${BUILD_OUTPUT_DIR} "${BUILD_OUTPUT_DIR}/icons"
) )
# Warnings # Build source files
include( CompilerWarnings ) add_subdirectory(src)
# Create and include version info file from git # ─────────────────────────────────────────────────────────────────────────────
include( GitVersionInfo ) # Stage Steam Audio runtimes alongside the built GDExtension
# ─────────────────────────────────────────────────────────────────────────────
add_subdirectory( src ) # Detect platform-specific subdirectories
if(WIN32)
set(STEAMAUDIO_SDK_ROOT "${CMAKE_SOURCE_DIR}/extern/steam-audio") if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_SA_RUNTIME_SUBDIR "windows-x64")
target_include_directories(${PROJECT_NAME} set(_SA_GDE_DIR "Windows-AMD64")
PRIVATE else()
${STEAMAUDIO_SDK_ROOT}/include set(_SA_RUNTIME_SUBDIR "windows-x86")
${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-cpp/include set(_SA_GDE_DIR "Windows-386")
${CMAKE_CURRENT_SOURCE_DIR}/src endif()
) elseif(APPLE)
set(_SA_RUNTIME_SUBDIR "ios") # switch to "osx" if targeting desktop
# Install library, extension file, and support files in ${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME} set(_SA_GDE_DIR "Darwin")
set( INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${PROJECT_NAME}/" ) elseif(ANDROID)
set(_SA_RUNTIME_SUBDIR "${ANDROID_ABI}")
message( STATUS "Install directory: ${INSTALL_DIR}") set(_SA_GDE_DIR "${ANDROID_ABI}")
elseif(UNIX)
install( TARGETS ${PROJECT_NAME} if(CMAKE_SIZEOF_VOID_P EQUAL 8)
LIBRARY set(_SA_RUNTIME_SUBDIR "linux-x64")
DESTINATION ${INSTALL_DIR}/${LIB_DIR} set(_SA_GDE_DIR "Linux-x64")
RUNTIME else()
DESTINATION ${INSTALL_DIR}/${LIB_DIR} set(_SA_RUNTIME_SUBDIR "linux-x86")
) set(_SA_GDE_DIR "Linux-x86")
endif()
# Copy over support files else()
install( DIRECTORY "${CMAKE_SOURCE_DIR}/support_files/" message(FATAL_ERROR "Unsupported platform for SteamAudioGodot")
DESTINATION ${INSTALL_DIR}
PATTERN ".*" EXCLUDE
)
add_subdirectory( templates )
# ccache
# Turns on ccache if found
include( ccache )
# Formatting
# Adds a custom target to format all the code at once
include( ClangFormat )
# godot-cpp
# From here: https://github.com/godotengine/godot-cpp
if ( NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/extern/godot-cpp/Makefile" )
message(
FATAL_ERROR
"[${PROJECT_NAME}] The godot-cpp submodule was not downloaded. Please update submodules: git submodule update --init --recursive."
)
endif() endif()
set( GODOT_CPP_SYSTEM_HEADERS ON CACHE BOOL "" FORCE ) # Path to prebuilt Steam Audio runtime files
set(_SA_RUNTIME_DIR "${CMAKE_CURRENT_SOURCE_DIR}/support_files/lib/${_SA_RUNTIME_SUBDIR}")
# Where Godot will load the binaries (target output directory already equals build_output/lib/Platform)
set(_SA_OUTPUT_DIR "$<TARGET_FILE_DIR:${PROJECT_NAME}>")
add_subdirectory( extern/godot-cpp ) # Copy the runtime files after build
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
set_target_properties( godot-cpp COMMAND ${CMAKE_COMMAND} -E make_directory "${_SA_OUTPUT_DIR}"
PROPERTIES COMMAND ${CMAKE_COMMAND} -E copy_directory
CXX_VISIBILITY_PRESET hidden # visibility needs to be the same as the main library "${_SA_RUNTIME_DIR}"
"${_SA_OUTPUT_DIR}"
) )
target_link_libraries( ${PROJECT_NAME} # Include paths for Steam Audio SDK and godot-cpp
PRIVATE target_include_directories(${PROJECT_NAME} PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/extern/steam-audio/include
${CMAKE_CURRENT_SOURCE_DIR}/extern/godot-cpp/include
${CMAKE_CURRENT_SOURCE_DIR}/src
)
# Installation setup
set(INSTALL_DIR "${CMAKE_SOURCE_DIR}/install/${PROJECT_NAME}/")
message(STATUS "Install directory: ${INSTALL_DIR}")
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${INSTALL_DIR}/${LIB_DIR}
LIBRARY DESTINATION ${INSTALL_DIR}/${LIB_DIR}
)
# Install Steam Audio runtime libraries into the addon install folder
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/support_files/lib/${_SA_RUNTIME_SUBDIR}/"
DESTINATION "${INSTALL_DIR}/${LIB_DIR}/"
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.so"
PATTERN "*.dylib"
PATTERN "*.a"
)
# Templates subdir
add_subdirectory(templates)
# ccache integration
include(ccache)
# Install Steam Audio runtime libraries into the addon install folder
install(
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/support_files/lib/${_SA_RUNTIME_SUBDIR}/"
DESTINATION "${INSTALL_DIR}/${LIB_DIR}/"
FILES_MATCHING
PATTERN "*.dll"
PATTERN "*.so"
PATTERN "*.dylib"
PATTERN "*.a"
)
# Code formatting
include(ClangFormat)
include(ccache)
# Code formatting
include(ClangFormat)
# godot-cpp bindings
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/extern/godot-cpp/Makefile")
message(FATAL_ERROR "[${PROJECT_NAME}] Missing godot-cpp submodule. Run: git submodule update --init --recursive.")
endif()
set(GODOT_CPP_SYSTEM_HEADERS ON CACHE BOOL "" FORCE)
add_subdirectory(extern/godot-cpp)
set_target_properties(godot-cpp PROPERTIES CXX_VISIBILITY_PRESET hidden)
# Link against godot-cpp and Steam Audio phonon library
# Add Steam Audio phonon lib search path
target_link_directories(${PROJECT_NAME} PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/extern/steam-audio/lib/${_SA_RUNTIME_SUBDIR}"
)
target_link_libraries(${PROJECT_NAME} PRIVATE
godot-cpp godot-cpp
phonon phonon
) )
target_link_directories(${PROJECT_NAME}
PRIVATE
${STEAMAUDIO_SDK_ROOT}/lib/windows-x64
)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${STEAMAUDIO_SDK_ROOT}/lib/windows-x64/phonon.dll"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>"
)

View File

@@ -13,14 +13,14 @@
"generator": "Ninja", "generator": "Ninja",
"hidden": true, "hidden": true,
"environment": { "environment": {
"PROJECT_NAME": "MyGodotExtention" "PROJECT_NAME": "SteamAudioGodotExtension"
} }
}, },
{ {
"name": "windows-debug", "name": "windows-debug",
"displayName": "64bit Windows Debug", "displayName": "64bit Windows Debug",
"inherits": "default", "inherits": "default",
"binaryDir": "${sourceDir}/../build_${env:PROJECT_NAME}_Windows-AMD64", "binaryDir": "builds/windows-amd64",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
@@ -52,7 +52,7 @@
"name": "linux-debug", "name": "linux-debug",
"displayName": "64bit Linux Debug", "displayName": "64bit Linux Debug",
"inherits": "default", "inherits": "default",
"binaryDir": "${sourceDir}/../build_${env:PROJECT_NAME}_Linux-x86_64", "binaryDir": "builds/linux-x86_x64",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",
@@ -76,7 +76,7 @@
"name": "macOS-debug", "name": "macOS-debug",
"displayName": "64bit macOS Debug", "displayName": "64bit macOS Debug",
"inherits": "default", "inherits": "default",
"binaryDir": "${sourceDir}/../build_${env:PROJECT_NAME}_Darwin-Universal", "binaryDir": "builds/DARWIN-Universal",
"condition": { "condition": {
"type": "equals", "type": "equals",
"lhs": "${hostSystemName}", "lhs": "${hostSystemName}",

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="API Reference" id="API_Reference">
<p>Start typing here...</p>
</topic>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="List API versions" id="List_API_versions">
<api-endpoint openapi-path="../../../openAPIspec.json" method="GET" endpoint="/"/>
</topic>

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic
SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd">
<topic xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd"
title="Show API version details" id="Show_API_version_details">
<api-endpoint openapi-path="../../../openAPIspec.json" method="GET" endpoint="/v2"/>
</topic>

View File

@@ -0,0 +1,11 @@
[configuration]
entry_symbol = "steam_audio_library_init"
compatibility_minimum = 4.1
[icons]
Example = "icons/Example.svg"
[libraries]
linux.debug.x86_64 = "lib/Linux-x86_64/libSteamAudioGodot-d.so"
macos.debug = "lib/Darwin-Universal/libSteamAudioGodot-d.dylib"
windows.debug.x86_64 = "lib/Windows-AMD64/libSteamAudioGodot-d.dll"

193
openAPIspec.json Normal file
View File

@@ -0,0 +1,193 @@
{
"openapi": "3.0.0",
"info": {
"title": "Simple API overview",
"version": "2.0.0"
},
"paths": {
"/": {
"get": {
"operationId": "listVersionsv2",
"summary": "List API versions",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"versions": [
{
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"id": "v2.0",
"links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
}
]
},
{
"status": "EXPERIMENTAL",
"updated": "2013-07-23T11:33:21Z",
"id": "v3.0",
"links": [
{
"href": "http://127.0.0.1:8774/v3/",
"rel": "self"
}
]
}
]
}
}
}
}
}
},
"300": {
"description": "300 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"versions": [
{
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"id": "v2.0",
"links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
}
]
},
{
"status": "EXPERIMENTAL",
"updated": "2013-07-23T11:33:21Z",
"id": "v3.0",
"links": [
{
"href": "http://127.0.0.1:8774/v3/",
"rel": "self"
}
]
}
]
}
}
}
}
}
}
}
}
},
"/v2": {
"get": {
"operationId": "getVersionDetailsv2",
"summary": "Show API version details",
"responses": {
"200": {
"description": "200 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"version": {
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.compute+xml;version=2"
},
{
"base": "application/json",
"type": "application/vnd.openstack.compute+json;version=2"
}
],
"id": "v2.0",
"links": [
{
"href": "http://127.0.0.1:8774/v2/",
"rel": "self"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
"type": "application/pdf",
"rel": "describedby"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
}
]
}
}
}
}
}
}
},
"203": {
"description": "203 response",
"content": {
"application/json": {
"examples": {
"foo": {
"value": {
"version": {
"status": "CURRENT",
"updated": "2011-01-21T11:33:21Z",
"media-types": [
{
"base": "application/xml",
"type": "application/vnd.openstack.compute+xml;version=2"
},
{
"base": "application/json",
"type": "application/vnd.openstack.compute+json;version=2"
}
],
"id": "v2.0",
"links": [
{
"href": "http://23.253.228.211:8774/v2/",
"rel": "self"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/os-compute-devguide-2.pdf",
"type": "application/pdf",
"rel": "describedby"
},
{
"href": "http://docs.openstack.org/api/openstack-compute/2/wadl/os-compute-2.wadl",
"type": "application/vnd.sun.wadl+xml",
"rel": "describedby"
}
]
}
}
}
}
}
}
}
}
}
}
}
}

View File

@@ -4,7 +4,8 @@ target_sources( ${PROJECT_NAME}
PRIVATE PRIVATE
register_types.cpp register_types.cpp
register_types.h register_types.h
steam_audio.cpp
steam_audio.h
) )
target_include_directories( ${PROJECT_NAME} target_include_directories( ${PROJECT_NAME}

View File

@@ -4,27 +4,28 @@
using namespace godot; using namespace godot;
void register_steam_audio_types() { void initialize_steam_audio(ModuleInitializationLevel p_level) {
ClassDB::register_class<SteamAudio>(); if (p_level!=MODULE_INITIALIZATION_LEVEL_SERVERS) {
return;
}
GDREGISTER_CLASS(SteamAudio);
}
void uninitialize_steam_audio(ModuleInitializationLevel p_level) {
if (p_level!=MODULE_INITIALIZATION_LEVEL_SERVERS) {
return;
}
} }
extern "C" GDE_EXPORT GDExtensionBool godot_steam_audio_init( extern "C" {
GDExtensionInterfaceGetProcAddress p_get_proc_address, // Initialization.
GDExtensionClassLibraryPtr p_library, GDExtensionBool GDE_EXPORT steam_audio_library_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
GDExtensionInitialization *p_initialization godot::GDExtensionBinding::InitObject init_obj(p_get_proc_address, p_library, r_initialization);
) {
// Create the InitObject that drives registration.
GDExtensionBinding::InitObject init_obj{ p_get_proc_address, p_library, p_initialization };
// 1) Hook up your initializer init_obj.register_initializer(initialize_steam_audio);
init_obj.register_initializer( register_steam_audio_types ); init_obj.register_terminator(uninitialize_steam_audio);
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
// 2) Hook up your terminator (must match the expected callback signature) return init_obj.init();
init_obj.register_terminator( [](ModuleInitializationLevel level) {} ); }
// 3) Choose the minimum init level (common choices: SCENE, EDITOR, etc.)
init_obj.set_minimum_library_initialization_level(MODULE_INITIALIZATION_LEVEL_SCENE);
// 4) Actually perform the registrations
return init_obj.init();
} }

View File

@@ -3,18 +3,9 @@
// //
#pragma once #pragma once
#include <godot_cpp/godot.hpp>
#include <godot_cpp/core/binder_common.hpp>
#include <godot_cpp/core/class_db.hpp> // for ClassDB #include <godot_cpp/core/class_db.hpp> // for ClassDB
using namespace godot; using namespace godot;
// Called by the InitObject below to register your SteamAudio class. // Called by the InitObject below to register your SteamAudio class.
void register_steam_audio_types(); void initialize_steam_audio(ModuleInitializationLevel p_level);
void uninitialize_steam_audio(ModuleInitializationLevel p_level);
// This is the exact symbol Godot will look up in your DLL.
extern "C" GDE_EXPORT GDExtensionBool godot_steam_audio_init(
GDExtensionInterfaceGetProcAddress p_get_proc_address,
GDExtensionClassLibraryPtr p_library,
GDExtensionInitialization *p_initialization
);

View File

@@ -10,14 +10,16 @@ using namespace godot;
{ {
if (context) if (context)
{ {
steam_audio_release_context(context); iplContextRelease(&context);
context=nullptr; context=nullptr;
} }
} }
void SteamAudio::_bind_methods() void SteamAudio::_bind_methods() {
{
ClassDB::bind_method(D_METHOD("initialize"), &SteamAudio::initialize); ClassDB::bind_method(D_METHOD("initialize"), &SteamAudio::initialize);
} }
SteamAudio::SteamAudio() = default;
bool SteamAudio::initialize() bool SteamAudio::initialize()
{ {
IPLContextSettings settings{}; IPLContextSettings settings{};

View File

@@ -7,20 +7,21 @@
#include <godot_cpp/godot.hpp> #include <godot_cpp/godot.hpp>
#include<godot_cpp/core/class_db.hpp> #include<godot_cpp/core/class_db.hpp>
#include <godot_cpp/classes/ref.hpp> #include <godot_cpp/classes/ref.hpp>
#include<godot_cpp/variant/utility_functions.hpp> #include <godot_cpp/variant/utility_functions.hpp>
#include<phonon.h> #include <phonon.h>
using namespace godot; using namespace godot;
class SteamAudio : RefCounted class SteamAudio : public RefCounted
{ {
GDCLASS( SteamAudio,RefCounted ); GDCLASS( SteamAudio,RefCounted ) // NOLINT(readability-use-auto)
private: private:
IPLContext context = nullptr; IPLContext context = nullptr;
protected: protected:
static void _bind_methods(); static void _bind_methods();
public: public:
SteamAudio(); SteamAudio();
~SteamAudio(); ~SteamAudio() override;
bool initialize(); bool initialize();
}; };

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
support_files/lib/ios/libphonon.a LFS Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>22G630</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>phonon</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string></string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>MacOSX</string>
</array>
<key>CSResourcesFileMapped</key>
<true/>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
<key>DTPlatformBuild</key>
<string></string>
<key>DTPlatformName</key>
<string>macosx</string>
<key>DTPlatformVersion</key>
<string>14.2</string>
<key>DTSDKBuild</key>
<string>23C53</string>
<key>DTSDKName</key>
<string>macosx14.2</string>
<key>DTXcode</key>
<string>1520</string>
<key>DTXcodeBuild</key>
<string>15C500b</string>
<key>LSMinimumSystemVersion</key>
<string>10.13</string>
</dict>
</plist>

View File

@@ -0,0 +1,115 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict/>
<key>files2</key>
<dict/>
<key>rules</key>
<dict>
<key>^Resources/</key>
<true/>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^.*</key>
<true/>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^Resources/.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^Resources/.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Resources/Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^[^/]+$</key>
<dict>
<key>nested</key>
<true/>
<key>weight</key>
<real>10</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

Binary file not shown.

View File

@@ -1,5 +1,5 @@
[configuration] [configuration]
entry_symbol = "GDExtensionInit" entry_symbol = "steam_audio_library_init"
compatibility_minimum = 4.1 compatibility_minimum = 4.1
[icons] [icons]