Updated to use komputesummator class
This commit is contained in:
parent
b5bdb2e7d1
commit
6ff55d4f3f
16 changed files with 95 additions and 121 deletions
29
examples/godot_examples/godot_resources/scripts/DynamicExampleScript.gd
Executable file
29
examples/godot_examples/godot_resources/scripts/DynamicExampleScript.gd
Executable file
|
|
@ -0,0 +1,29 @@
|
|||
extends Node2D
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
||||
print("hello")
|
||||
|
||||
# Use existing node
|
||||
print($KomputeNode.get_total())
|
||||
|
||||
$KomputeNode.add(10)
|
||||
print($KomputeNode.get_total())
|
||||
|
||||
$KomputeNode.add(10)
|
||||
print($KomputeNode.get_total())
|
||||
|
||||
# Create new instance
|
||||
var s = KomputeSummator.new()
|
||||
|
||||
# This will print 0 as it's a new instance
|
||||
print(s.get_total())
|
||||
|
||||
# Now we can again send further commands
|
||||
s.add(10)
|
||||
print(s.get_total())
|
||||
|
||||
s.add(10)
|
||||
print(s.get_total())
|
||||
|
||||
8
examples/godot_examples/godot_resources/scripts/KomputeNativeClass.gdns
Executable file
8
examples/godot_examples/godot_resources/scripts/KomputeNativeClass.gdns
Executable file
|
|
@ -0,0 +1,8 @@
|
|||
[gd_resource type="NativeScript" load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://godot_resources/scripts/KomputeNativeLibrary.gdnlib" type="GDNativeLibrary" id=1]
|
||||
|
||||
[resource]
|
||||
class_name = "KomputeSummator"
|
||||
library = ExtResource( 1 )
|
||||
script_class_name = "KomputeSummator"
|
||||
14
examples/godot_examples/godot_resources/scripts/KomputeNativeLibrary.gdnlib
Executable file
14
examples/godot_examples/godot_resources/scripts/KomputeNativeLibrary.gdnlib
Executable file
|
|
@ -0,0 +1,14 @@
|
|||
[general]
|
||||
|
||||
singleton=false
|
||||
load_once=true
|
||||
symbol_prefix="godot_"
|
||||
reloadable=false
|
||||
|
||||
[entry]
|
||||
|
||||
Windows.64="res://gdnative_shared/build/Release/kompute_godot.dll"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Windows.64=[ ]
|
||||
Loading…
Add table
Add a link
Reference in a new issue