Implement NativeExtension pointer arguments

* Allows calling into native extensions directly with a pointer
* Makes it easier to implement some APIs more efficiently
* Appears with a "*" in the documentation for the argument.
* Implementing the pointer handling is entirely up to the implementation, although the extension API provides some hint.
* AudioStream has been implemented as an example, allowing to create NativeExtension based AudioStreams.
This commit is contained in:
reduz 2021-08-23 14:53:27 -03:00
parent 679b9be9d3
commit 44d62a9f4b
18 changed files with 370 additions and 25 deletions

View file

@ -272,8 +272,12 @@ void AudioStreamPlayer2D::set_stream(Ref<AudioStream> p_stream) {
}
if (p_stream.is_valid()) {
stream = p_stream;
stream_playback = p_stream->instance_playback();
if (stream_playback.is_valid()) {
stream = p_stream;
} else {
stream.unref();
}
}
AudioServer::get_singleton()->unlock();