Compare commits

...

6 Commits

Author SHA1 Message Date
Nyx
9dfe1cde73 added junie guidelines
Some checks failed
Main / 🧹 Lint / 📜 C++ (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Debug) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Release) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Release) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Release) (push) Has been cancelled
2025-10-29 23:06:23 -06:00
Nyx
f45e06d292 update Steam Audio to 4.7.0
Some checks failed
Main / 🧹 Lint / 📜 C++ (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Debug) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Release) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Release) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Release) (push) Has been cancelled
2025-10-28 20:31:20 -06:00
Nyx
2b51e93714 fix shing
Some checks failed
Main / 🧹 Lint / 📜 C++ (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Debug) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Release) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Release) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Release) (push) Has been cancelled
2025-10-28 13:44:35 -06:00
Nyx
14d35e9a3e updated godot cpp to use 4.5
Some checks failed
Main / 🧹 Lint / 📜 C++ (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Debug) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Release) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Release) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Release) (push) Has been cancelled
2025-10-28 10:18:36 -06:00
Nyx
32b0cb6ea3 Merge branch 'main' of https://git.arcaneasylumstudios.com/therivernyx/steam-audio-godot
Some checks failed
Main / 🧹 Lint / 📜 C++ (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Debug) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Debug) (push) Has been cancelled
Main / 🛠 Build / 🍏 macOS Clang (Release) (push) Has been cancelled
Main / 🛠 Build / 🐧 Linux GCC (Release) (push) Has been cancelled
Main / 🛠 Build / 🪟 Windows MSVC (Release) (push) Has been cancelled
2025-10-27 16:41:32 -06:00
Nyx
e2c747f1b2 work 2025-10-27 11:58:38 -06:00
13 changed files with 237 additions and 19 deletions

68
.junie/guidelines.md Normal file
View File

@@ -0,0 +1,68 @@
# Project Guidelines
## Project overview
SteamAudioGodot is a Godot 4 GDExtension that integrates Valves Steam Audio SDK to provide physically based spatial audio (HRTF, occlusion, reflections, raytraced propagation). The repository builds a shared native library that Godot loads via a `.gdextension` manifest located under the demo addon.
- Language/tech: C++17, CMake, Godot 4 GDExtension, Steam Audio SDK, `godot-cpp` bindings
- Primary library target: `SteamAudioGodot` (shared library)
- Bindings target: `godot-cpp`
- Helper targets: `templates`, `generate_bindings`
- Entry point symbol: `steam_audio_library_init` (see `src/register_types.cpp`)
- Example registered classes: `SteamAudio`, `SteamAudioListener`, `SteamAudioSource`, `SteamAudioStaticMesh`, `SteamAudioDynamicMesh`, server singleton `SteamAudioServer`
### Repository layout (high level)
- `src/` — C++ sources for the GDExtension
- `extern/godot-cpp/` — Godot C++ bindings (submodule)
- `extern/steam-audio/` — Steam Audio SDK
- `support_files/lib/<platform>/` — Prebuilt runtime libs staged next to the built extension
- `demo/` — Example Godot project with the addon under `addons/SteamAudioGodot`
- `templates/` — CMake templates and supplemental files
- `Writerside/` — Documentation sources (JetBrains Writerside)
See also the detailed overview in `README.md` (sections: Overview, Building, Installing into a Godot project, Project structure).
## How Junie should build and verify
- Use the existing CLion CMake profile only.
- Active profile: `Debug`
- Build directory: `cmake-build-debug`
- Toolchain: local MinGW
- When a build is required, prefer building a specific target:
- Main target: `SteamAudioGodot`
- Example command (run via CLion profile environment): `cmake --build cmake-build-debug --target SteamAudioGodot`
- In this environment, always use the special CMake-profile execution tool when issuing build commands (not raw shell).
- Do not create new CMake build directories or presets unless explicitly requested.
- For documentationonly or commentsonly changes: do not build.
- For native code or CMake changes: build `SteamAudioGodot` in Debug to smokecheck.
### Build outputs (typical)
- Artifacts are written under the CMake build directory, e.g.: `cmake-build-debug/SteamAudioGodot/lib/<Platform-Arch>/`
- Runtime Steam Audio binaries are staged next to the built library after build.
## Tests policy
- There are currently no automated tests in this repository.
- Do not create or run tests unless explicitly requested for a task.
## Code style and contribution guidance
- Follow existing file/module style: indentation, naming, include order, and comments.
- C++ standard: C++17.
- Keep changes minimal and localized; avoid sweeping refactors unless requested.
- When renaming any code element (class/function/variable), use the projects rename mechanism that updates all references consistently.
- Match Windows path separators (`\`) in paths and adapt shell commands to PowerShell when needed.
## Quick reference: CMake targets
- `SteamAudioGodot` — main shared library (GDExtension)
- `godot-cpp` — bindings library (dependency)
- `generate_bindings` — bindings generator (from `godot-cpp`)
- `templates` — installs helper files/templates
## When to run the application
- This repository produces a library to be loaded by Godot. Running the editor/project is generally outside the scope of routine CI checks here.
- To try the addon, open the `demo/` folder in Godot 4 after building and ensure the addon is present under `demo/addons/SteamAudioGodot`.
## Troubleshooting pointers
- Missing `godot-cpp` submodule: run `git submodule update --init --recursive`.
- Godot cannot load the extension: verify the `.gdextension` file library paths and that required runtime DLLs/SOs exist under `addons/SteamAudioGodot/lib/<Platform-Arch>/`.
## External API Documentation
- Steam Audio SDK: https://valvesoftware.github.io/steam-audio/doc/capi/index.html
- Godot GDExtension: https://docs.godotengine.org/en/stable

View File

@@ -0,0 +1 @@
{"requests":[{"kind":"cache","version":2},{"kind":"codemodel","version":2},{"kind":"toolchains","version":1},{"kind":"cmakeFiles","version":1}]}

View File

@@ -0,0 +1,109 @@
# This is the CMakeCache file.
# For build in directory: d:/GitHub/steam-audio-godot/builds/windows-amd64
# It was generated by CMake: C:/Program Files/CMake/bin/cmake.exe
# You can edit this file to change values found and used by cmake.
# If you do not want to change any of the values, simply exit the editor.
# If you do want to change a value, simply edit, save, and exit the editor.
# The syntax for the file is as follows:
# KEY:TYPE=VALUE
# KEY is the name of a variable in the cache.
# TYPE is a hint to GUIs for the type of VALUE, DO NOT EDIT TYPE!.
# VALUE is the current value for the KEY.
########################
# EXTERNAL cache entries
########################
//No help, variable specified on the command line.
CMAKE_BUILD_TYPE:UNINITIALIZED=Debug
//No help, variable specified on the command line.
CMAKE_CXX_COMPILER:UNINITIALIZED=cl.exe
//No help, variable specified on the command line.
CMAKE_C_COMPILER:UNINITIALIZED=cl.exe
//Value Computed by CMake.
CMAKE_FIND_PACKAGE_REDIRECTS_DIR:STATIC=D:/GitHub/steam-audio-godot/builds/windows-amd64/CMakeFiles/pkgRedirects
//Program used to build from build.ninja files.
CMAKE_MAKE_PROGRAM:FILEPATH=CMAKE_MAKE_PROGRAM-NOTFOUND
//Value Computed by CMake
CMAKE_PROJECT_DESCRIPTION:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=SteamAudioGodot
//Value Computed by CMake
CMAKE_PROJECT_VERSION:STATIC=0.1.0
//Value Computed by CMake
CMAKE_PROJECT_VERSION_MAJOR:STATIC=0
//Value Computed by CMake
CMAKE_PROJECT_VERSION_MINOR:STATIC=1
//Value Computed by CMake
CMAKE_PROJECT_VERSION_PATCH:STATIC=0
//Value Computed by CMake
CMAKE_PROJECT_VERSION_TWEAK:STATIC=
//Value Computed by CMake
SteamAudioGodot_BINARY_DIR:STATIC=D:/GitHub/steam-audio-godot/builds/windows-amd64
//Value Computed by CMake
SteamAudioGodot_IS_TOP_LEVEL:STATIC=ON
//Value Computed by CMake
SteamAudioGodot_SOURCE_DIR:STATIC=D:/GitHub/steam-audio-godot
########################
# INTERNAL cache entries
########################
//This is the directory where this CMakeCache.txt was created
CMAKE_CACHEFILE_DIR:INTERNAL=d:/GitHub/steam-audio-godot/builds/windows-amd64
//Major version of cmake used to create the current loaded cache
CMAKE_CACHE_MAJOR_VERSION:INTERNAL=4
//Minor version of cmake used to create the current loaded cache
CMAKE_CACHE_MINOR_VERSION:INTERNAL=0
//Patch version of cmake used to create the current loaded cache
CMAKE_CACHE_PATCH_VERSION:INTERNAL=2
//Path to CMake executable.
CMAKE_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cmake.exe
//Path to cpack program executable.
CMAKE_CPACK_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cpack.exe
//Path to ctest program executable.
CMAKE_CTEST_COMMAND:INTERNAL=C:/Program Files/CMake/bin/ctest.exe
//Path to cache edit program executable.
CMAKE_EDIT_COMMAND:INTERNAL=C:/Program Files/CMake/bin/cmake-gui.exe
//Name of external makefile project generator.
CMAKE_EXTRA_GENERATOR:INTERNAL=
//Name of generator.
CMAKE_GENERATOR:INTERNAL=Ninja
//Generator instance identifier.
CMAKE_GENERATOR_INSTANCE:INTERNAL=
//Name of generator platform.
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=D:/GitHub/steam-audio-godot
//Name of CMakeLists files to read
CMAKE_LIST_FILE_NAME:INTERNAL=CMakeLists.txt
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
CMAKE_MAKE_PROGRAM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
//Platform information initialized
CMAKE_PLATFORM_INFO_INITIALIZED:INTERNAL=1
//Path to CMake installation.
CMAKE_ROOT:INTERNAL=C:/Program Files/CMake/share/cmake-4.0

View File

@@ -0,0 +1,15 @@
set(CMAKE_HOST_SYSTEM "Windows-10.0.26200")
set(CMAKE_HOST_SYSTEM_NAME "Windows")
set(CMAKE_HOST_SYSTEM_VERSION "10.0.26200")
set(CMAKE_HOST_SYSTEM_PROCESSOR "AMD64")
set(CMAKE_SYSTEM "Windows-10.0.26200")
set(CMAKE_SYSTEM_NAME "Windows")
set(CMAKE_SYSTEM_VERSION "10.0.26200")
set(CMAKE_SYSTEM_PROCESSOR "AMD64")
set(CMAKE_CROSSCOMPILING "FALSE")
set(CMAKE_SYSTEM_LOADED 1)

View File

@@ -0,0 +1,11 @@
---
events:
-
kind: "message-v1"
backtrace:
- "C:/Program Files/CMake/share/cmake-4.0/Modules/CMakeDetermineSystem.cmake:205 (message)"
- "CMakeLists.txt:40 (project)"
message: |
The system is: Windows - 10.0.26200 - AMD64
...

View File

@@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file

View File

@@ -12,6 +12,8 @@ void initialize_steam_audio(ModuleInitializationLevel p_level) {
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
GDREGISTER_CLASS(SteamAudioServer);
srv = memnew(SteamAudioServer);
Engine::get_singleton()->register_singleton("SteamAudioServer", srv);
srv->initialize();
}
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
@@ -28,6 +30,7 @@ void initialize_steam_audio(ModuleInitializationLevel p_level) {
void uninitialize_steam_audio(ModuleInitializationLevel p_level) {
if (p_level == MODULE_INITIALIZATION_LEVEL_SERVERS) {
memdelete(srv);
srv = nullptr;
}
}

View File

@@ -37,16 +37,16 @@ void SteamAudioListener::_notification(int p_what) {
}
}
void SteamAudioListener::update_listener(IPLSimulator iplsim, IPLSimulationSharedInputs iplsiminputs) {
needs_update=false;
void SteamAudioListener::update_listener(IPLSimulator iplSim, IPLSimulationSharedInputs iplSimInputs) {
needs_update = false;
Transform3D transform = get_global_transform();
IPLCoordinateSpace3 space = SteamAudio::godot_to_ipl_space(transform);
iplsiminputs.listener=space;
iplSimInputs.listener = space;
iplSimulatorSetSharedInputs(iplsim,IPL_SIMULATIONFLAGS_DIRECT,&iplsiminputs);
iplSimulatorSetSharedInputs(iplsim,IPL_SIMULATIONFLAGS_PATHING,&iplsiminputs);
iplSimulatorSetSharedInputs(iplsim,IPL_SIMULATIONFLAGS_REFLECTIONS,&iplsiminputs);
iplSimulatorSetSharedInputs(iplSim, IPL_SIMULATIONFLAGS_DIRECT, &iplSimInputs);
iplSimulatorSetSharedInputs(iplSim, IPL_SIMULATIONFLAGS_PATHING, &iplSimInputs);
iplSimulatorSetSharedInputs(iplSim, IPL_SIMULATIONFLAGS_REFLECTIONS, &iplSimInputs);
}

View File

@@ -12,12 +12,14 @@ using namespace godot;
class SteamAudioListener:public AudioListener3D
{
GDCLASS(SteamAudioListener,AudioListener3D)
private:
bool needs_update = false;
Transform3D last_transform;
protected:
static void _bind_methods();
public:
bool get_needs_update() {
return needs_update;
@@ -29,7 +31,7 @@ public:
void _notification(int p_what);
static SteamAudioListener* get_listener();
void update_listener(IPLSimulator iplsim, IPLSimulationSharedInputs iplsiminputs);
void update_listener(IPLSimulator iplSim, IPLSimulationSharedInputs iplSimInputs);
void set_listener_position(const Vector3 &p_position);
void set_listener_orientation(const Vector3 &p_forward, const Vector3 &p_up);
void set_listener_velocity(const Vector3 &p_velocity);

View File

@@ -3,10 +3,9 @@
using namespace godot;
SteamAudioServer::SteamAudioServer() {
}
SteamAudioServer::~SteamAudioServer() {
SteamAudioServer::~SteamAudioServer() {
shutdown();
}
@@ -17,10 +16,13 @@ void SteamAudioServer::_bind_methods() {
void SteamAudioServer::initialize() {
if (Engine::get_singleton()->is_editor_hint())
return;
IPLerror err = iplContextCreate(&ctxSettings,&ctx);
if (err!=IPL_STATUS_SUCCESS) {
ERR_PRINT("Failed to create IPL context");
}
switch (static_cast<int>(proj_settings->get_setting("steam_audio/ray_tracer/RayTracer"))){
case 0:
break;
@@ -60,6 +62,8 @@ void SteamAudioServer::_notification(int p_what) {
directThread->start(callable_mp(this,&SteamAudioServer::start_direct_thread),Thread::PRIORITY_NORMAL);
indirectThread->start(callable_mp(this,&SteamAudioServer::start_indirect_thread),Thread::PRIORITY_NORMAL);
default:
return;
}
}
void SteamAudioServer::start_direct_thread() {

View File

@@ -1,21 +1,22 @@
#pragma once
#include <godot_cpp/classes/audio_frame.hpp>
#include <godot_cpp/classes/mutex.hpp>
#include <godot_cpp/classes/scene_tree.hpp>
#include <godot_cpp/classes/thread.hpp>
#include <godot_cpp/classes/wrapped.hpp>
#include <godot_cpp/core/class_db.hpp>
#include <godot_cpp/godot.hpp>
#include <godot_cpp/classes/thread.hpp>
#include <godot_cpp/classes/mutex.hpp>
#include <phonon.h>
#include <steam_audio.hpp>
#include <unordered_map>
#include "steam_audio_dynamic_mesh.hpp"
#include "steam_audio_source.hpp"
#include "steam_audio_static_mesh.hpp"
using namespace godot;
class SteamAudioServer : public Object {
GDCLASS(SteamAudioServer, Object) // Godot class declaration macro
private:
@@ -27,7 +28,7 @@ private:
bool needs_processing = false;
};
std::unordered_map<SteamAudioSource*,AudioSourceData> audio_sources;
std::unordered_map<SteamAudioSource *, AudioSourceData> audio_sources;
Ref<Mutex> audio_mutex;
IPLContext ctx=nullptr;
IPLContextSettings ctxSettings;
@@ -47,8 +48,8 @@ private:
Ref<Thread> indirectThread;
public:
SteamAudioServer(); // Constructor
~SteamAudioServer() override; // Destructor
SteamAudioServer();
~SteamAudioServer() override;
void _notification(int p_what);
void register_audio_source(SteamAudioSource *source);
void unregister_audio_source(SteamAudioSource *source);
@@ -57,8 +58,11 @@ public:
protected:
static void _bind_methods();
public:
void initialize();
void shutdown();
void start_direct_thread();
void start_indirect_thread();
};