Skip to content
Snippets Groups Projects
Commit 1e366750 authored by Florent Berthaut's avatar Florent Berthaut
Browse files

Fixed windows cross-compiling and updated readme

parent bbac9e80
Branches
No related tags found
No related merge requests found
# gdpd # gdpd
Godot add-on for loading and processing Pure Data patches gdpd is a Godot add-on for loading and processing Pure Data patches.
# Using
In a script,
1. Initalize gdpd
```python
onready var gdpd = load("res://addons/gdpd/bin/gdpd.gdns").new()
```
2. Initialize the audio inputs and outputs
```python
#retrieve the list of available input and outputs
var inps = _gdpd.get_available_input_devices()
var outs = _gdpd.get_available_output_devices()
#initialise the first ones
_gdpd.init_devices(inps[0], outs[0])
```
4. Load a patch
```python
var patch = ProjectSettings.globalize_path("res://patch.pd")
var patch_name = patch.split("/")[-1]
var patch_dir = patch.trim_suffix(patch_name)
gdpd.openfile(patch_name, patch_dir)
```
5. Send a message to the patch
```python
#send message to [receive from_godot] with one symbol
_gdpd.start_message(1)
_gdpd.add_symbol("hello")
_gdpd.finish_list("from_godot")
```
6. Subscribe and receive messages from the patch
```python
func _ready :
#listen to messages sent with [send to_godot]
_gdpd.subscribe("to_godot")
func _process :
while _gdpd.has_message() :
#msg is an array with the list of symbols/floats sent to to_godot
var msg = _gdpd.get_next()
print("got message from pd ", msg)
```
For a full working example, open the Godot project in the demo folder.
# Compiling # Compiling
## Compiling on GNU/Linux ## Compiling for GNU/Linux
- Install the following packages : - Install the following packages :
- scons - scons
...@@ -14,16 +73,17 @@ Godot add-on for loading and processing Pure Data patches ...@@ -14,16 +73,17 @@ Godot add-on for loading and processing Pure Data patches
- cd gdpd - cd gdpd
- ./update.sh linux - ./update.sh linux
## Compiling on Windows ## Cross-compiling for Windows on GNU/Linux
- Open the Windows Powershell - Install the following packages :
- mingw-64
- Type the following commands : - Type the following commands :
- git clone https://gitlab.univ-lille.fr/ivmi/gdpd.git - git clone https://gitlab.univ-lille.fr/ivmi/gdpd.git
- cd gdpd - cd gdpd
- ./update.sh windows - ./update.sh windows
## Compiling on Mac OSX ## Compiling for Mac OSX
## Compiling for Android (/ Oculus Quest) ## Compiling for Android (/ Oculus Quest)
......
...@@ -10,9 +10,9 @@ env = Environment(ENV = os.environ) ...@@ -10,9 +10,9 @@ env = Environment(ENV = os.environ)
opts.Add(EnumVariable('target', "Compilation target", 'release', ['d', 'debug', 'r', 'release'])) opts.Add(EnumVariable('target', "Compilation target", 'release', ['d', 'debug', 'r', 'release']))
opts.Add(EnumVariable('platform', "Compilation platform", '', ['', 'windows', 'x11', 'linux', 'osx'])) opts.Add(EnumVariable('platform', "Compilation platform", '', ['', 'windows', 'x11', 'linux', 'osx']))
opts.Add(EnumVariable('p', "Compilation target, alias for 'platform'", '', ['', 'windows', 'x11', 'linux', 'osx'])) opts.Add(EnumVariable('p', "Compilation target, alias for 'platform'", '', ['', 'windows', 'x11', 'linux', 'osx']))
opts.Add(BoolVariable('use_llvm', "Use the LLVM / Clang compiler", 'no')) opts.Add(BoolVariable('use_llvm', "Use the LLVM / Clang compiler", 'yes'))
opts.Add(BoolVariable('use_mingw', "Use the MingW for cross-compiling", 'no')) opts.Add(BoolVariable('use_mingw', "Use the MingW for cross-compiling", 'no'))
opts.Add(PathVariable('target_path', 'The path where the lib is installed.', 'GdpdExample/addons/gdpd/bin/')) opts.Add(PathVariable('target_path', 'The path where the lib is installed.', 'demo/addons/gdpd/bin/'))
opts.Add(PathVariable('target_name', 'The library name.', 'libgdpd', PathVariable.PathAccept)) opts.Add(PathVariable('target_name', 'The library name.', 'libgdpd', PathVariable.PathAccept))
# Local dependency paths, adapt them to your setup # Local dependency paths, adapt them to your setup
......
...@@ -14,7 +14,7 @@ _global_script_class_icons={ ...@@ -14,7 +14,7 @@ _global_script_class_icons={
[application] [application]
config/name="GdpdExample" config/name="GdPd"
run/main_scene="res://Main.tscn" run/main_scene="res://Main.tscn"
run/low_processor_mode=true run/low_processor_mode=true
config/icon="res://icon.png" config/icon="res://icon.png"
......
No preview for this file type
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
git config --global url."https://".insteadOf git:// git config --global url."https://".insteadOf git://
git submodule update --init --recursive git submodule update --init --recursive
cd src/godot-cpp cd src/godot-cpp
scons platform=$1 generate_bindings=yes target=release scons platform=$1 generate_bindings=yes target=release use_mingw=yes
cd ../.. cd ../..
scons platform=$1 target=release scons platform=$1 target=release use_mingw=yes
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment