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

Custom Engine support for ecsact language? #330

Open
Shadowblitz16 opened this issue Dec 2, 2024 · 1 comment
Open

Custom Engine support for ecsact language? #330

Shadowblitz16 opened this issue Dec 2, 2024 · 1 comment

Comments

@Shadowblitz16
Copy link

First of all I would like to say this is a awesome project.

Also I would like to use then in my own game engine.
Can this support Custom Engines like stuff made in Silk.NET?

@zaucy
Copy link
Member

zaucy commented Dec 2, 2024

Hey thanks for checking Ecsact out!

Yes custom engine or no-engine projects are supported although its a bit more work to get started. You'll mostly be working with the ecsact CLI to do code generation and build a shared library for the ecsact runtime based on your .ecsact files.

Here's a couple resources you might be interested in

I'm not very familiar with Silk.NET, but to get you started a bit I'd suggest generating some C# with ecsact codegen.

ecsact codegen example.ecsact --plugin=csharp

This will generate some C# files that end with *.ecsact.cs that represent each of your .ecsact files.

Similar can be done for creating the ecsact runtime shared library

ecsact build example.ecsact -r rt_entt -o your_ecsact_runtime

This should generate a shared library called your_ecsact_runtime.dll on windows and your_ecsact_runtime.so on linux.

NOTE: it is crucial that both codegen and runtime are built with the same ecsact files!

After building the runtime you'll have to do a little marshaling of the C API which can be quite involved. We've done it once for the unity integration and you can use it as inspiration https://github.com/ecsact-dev/ecsact_unity/blob/release/Runtime/EcsactRuntime.cs#L2695-L2700. I think at some point we might need to create a general wrapper that isn't unity specific to help out all you C# folks :)

One possibility (that we have not tried) is using a bindings generator on the ecsact runtime C headers (here: https://github.com/ecsact-dev/ecsact_runtime/tree/main/ecsact/runtime).

All that being said we are more than happy to help you further. Either keep posting here or give us a shout on our discord https://discord.gg/vKxQztg7gB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants