Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: No bindings for C# #10

Closed
DmitriySalnikov opened this issue Mar 26, 2023 · 20 comments
Closed

[Bug]: No bindings for C# #10

DmitriySalnikov opened this issue Mar 26, 2023 · 20 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@DmitriySalnikov
Copy link
Owner

Godot version

4.x

DebugDraw3D version

179ad80

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

@DmitriySalnikov DmitriySalnikov added the bug Something isn't working label Mar 26, 2023
@DmitriySalnikov
Copy link
Owner Author

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.

@DmitriySalnikov DmitriySalnikov added the enhancement New feature or request label May 30, 2023
@GeorgeS2019
Copy link

@wp2000x
Copy link

wp2000x commented Jul 6, 2023

Are C# bindings now possible in GD 4.1?

@DmitriySalnikov
Copy link
Owner Author

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.

@GeorgeS2019
Copy link

@DmitriySalnikov
I have done further GDExtension c# Binding. Not writing further to avoid Spanning impression

@DmitriySalnikov
Copy link
Owner Author

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.

@GeorgeS2019
Copy link

@DmitriySalnikov Thx for your encouragement

@GeorgeS2019
Copy link

@DmitriySalnikov I saw u resume this recently.

Are there still open issues?

@DmitriySalnikov
Copy link
Owner Author

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#.

@DmitriySalnikov
Copy link
Owner Author

DmitriySalnikov commented Sep 11, 2023

@GeorgeS2019
image

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).

@GeorgeS2019
Copy link

GeorgeS2019 commented Sep 11, 2023

@DmitriySalnikov
Native structures and pointers in c#

godotengine/godot-proposals#7024 (comment)

@DmitriySalnikov
Copy link
Owner Author

Isn't it about adding support for NativeStucts that were originally registered for GDExtension?
Like AudioFrame

@GeorgeS2019
Copy link

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!

@DmitriySalnikov
Copy link
Owner Author

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.

@DmitriySalnikov
Copy link
Owner Author

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.

@GeorgeS2019
Copy link

Which Godot 4 version is used to open. It crashes using 4.2 Dev 4

@DmitriySalnikov
Copy link
Owner Author

DmitriySalnikov commented Sep 13, 2023

What do you mean?
The library is built for 4.1+

Godot_v4 2-dev4_mono_win64_ZhATopaTlf

@GeorgeS2019
Copy link

Still trying to understand why the editor crashes using Godot4.2 Dev4

image

@DmitriySalnikov
Copy link
Owner Author

DmitriySalnikov commented Sep 13, 2023

image

Well, after this line, the generation of bindings should happen


I think I know what the problem is, I'll fix it now

@DmitriySalnikov
Copy link
Owner Author

updated libraries will be here https://github.com/DmitriySalnikov/godot_debug_draw_3d/actions/runs/6177991021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants