Closed DmitriySalnikov closed 1 year ago
Following this article, API generation for C# is planned in future versions.
Consuming APIs provided by a GDExtension is also currently unsupported. We’ll keep working on bridging the gap between GDExtension and C# in future 4.x releases.
Are C# bindings now possible in GD 4.1?
Officially, there is no such possibility, but I haven't tried to make my own bindings yet. I heard that there were problems when trying to use classes from GDExtension in C#. I do not know whether it was fixed or not.
@DmitriySalnikov I have done further GDExtension c# Binding. Not writing further to avoid Spanning impression
I have done further GDExtension c# Binding
@GeorgeS2019 have you thought about starting to do PR for Godot with an API generator for GDExtension? Godot itself has this generator for a long time and it is used only when running with the --generate-mono-glue
argument. All that is needed, it seems to me, is to run this generator for GDExtension through the editor, put the generated sources in a separate folder, compile them into a separate DLL and add this DLL as "friendly" (so that it can use internal
classes) to the core of the Godot Mono library.
But, most likely, you need to create a godot-proposal
first and discuss how best to do it with the Godot core team.
@DmitriySalnikov Thx for your encouragement
@DmitriySalnikov I saw u resume this recently.
Are there still open issues?
I replied to a PR that allows me to reload libraries without having to restart the editor. With it, I could run the editor 1 time and rebuild the library several times. Unfortunately this has nothing to do with C#.
@GeorgeS2019
Everything works again via GodotObject.Call
, no native pointers, as in bindings for the engine. Therefore, I cannot guarantee high performance.
Bindings are generated manually by my generator.
The commit will be later (still no default values for the arguments).
@DmitriySalnikov Native structures and pointers in c#
https://github.com/godotengine/godot-proposals/discussions/7024#discussioncomment-6851198
Isn't it about adding support for NativeStucts
that were originally registered for GDExtension
?
Like AudioFrame
I will speak to him again
He understands very in depth what are missing now but beyond my understanding
We are getting closer to the goal!
Nothing else is needed for my binding generator at the moment. After its release, I will wait for the official generator for GDExtension <=> C#
. I'm not really interested in participating in adding an official feature right now.
I added a generator and updated the binaries. You can download the update here: https://github.com/DmitriySalnikov/godot_debug_draw_3d/archive/3c76608fd2409830bdbdd97a775d15ce5bef2202.zip
Also here the name DebugDraw
was changed to DebugDraw3D
and DebugDraw2D
.
Which Godot 4 version is used to open. It crashes using 4.2 Dev 4
What do you mean? The library is built for 4.1+
Still trying to understand why the editor crashes using Godot4.2 Dev4
Well, after this line, the generation of bindings should happen
I think I know what the problem is, I'll fix it now
updated libraries will be here https://github.com/DmitriySalnikov/godot_debug_draw_3d/actions/runs/6177991021
Godot version
4.x
DebugDraw3D version
179ad806d520069e10ab6309cbb8799afc84d8c5
On which operating systems the error occurs
No response
Using which renderers the error occurs
No response
Issue description
Due to differences in the work of GDExtension and the new versions of .NET in Godot, C# support was temporarily removed during porting. To solve this, I need to either write a new API generator, or someone needs to extend the generator in the engine itself.
Steps to reproduce
N/A
Minimal reproduction project
N/A