Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Open sidebar
PimPam Games Studio
gdnative-go
Commits
f5daf20b
Commit
f5daf20b
authored
Oct 10, 2020
by
Oscar Campos
Committed by
Oscar Campos
Oct 11, 2020
Browse files
chore: add SimpleDemoManual example
parent
ca47a26b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
example/SimpleDemoManual/src/simple.go
example/SimpleDemoManual/src/simple.go
+6
-6
No files found.
example/SimpleDemoManual/src/simple.go
View file @
f5daf20b
...
...
@@ -23,16 +23,16 @@ func nativeScriptInit() {
// Define an instance creation function. This will be called when Godot
// creates a new instance of our class.
createFunc
:=
gdnative
.
InstanceCreateFunc
{
CreateFunc
:
simpleConstructor
,
// reference to the constructor function
MethodData
:
"SIMPLE"
,
// name of the class the constructor is attached to
CreateFunc
:
simpleConstructor
,
// reference to the constructor function
MethodData
:
"SIMPLE"
,
// name of the class the constructor is attached to
FreeFunc
:
func
(
methodData
string
)
{},
// function for freeing resources (usually empty)
}
// Define an instance destroy function. This will be called when Godot
// asks our library to destroy our class instance.
destroyFunc
:=
gdnative
.
InstanceDestroyFunc
{
DestroyFunc
:
simpleDestructor
,
// reference to the destructor function
MethodData
:
"SIMPLE"
,
// name of the class the destructor is attached to
DestroyFunc
:
simpleDestructor
,
// reference to the destructor function
MethodData
:
"SIMPLE"
,
// name of the class the destructor is attached to
FreeFunc
:
func
(
methodData
string
)
{},
// function for freeing resources (usually empty)
}
...
...
@@ -54,8 +54,8 @@ func nativeScriptInit() {
RPCType
:
gdnative
.
MethodRpcModeDisabled
,
},
&
gdnative
.
InstanceMethod
{
// method wrapper
Method
:
simpleMethod
,
// the simpleMethod function reference that implements our logic
MethodData
:
"
get_data"
,
// method name as will be used with in Godot
Method
:
simpleMethod
,
// the simpleMethod function reference that implements our logic
MethodData
:
"
SIMPLE"
,
// method name as will be used with in Godot
FreeFunc
:
func
(
methodData
string
)
{},
// function for freeing resources (usually empty)
},
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment