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

Document design goals of godot-cpp and common pitfalls that new users have #10254

Open
dsnopek opened this issue Nov 12, 2024 · 0 comments
Open

Comments

@dsnopek
Copy link
Contributor

dsnopek commented Nov 12, 2024

There are a number of things we end up having to re-explain frequently with godot-cpp, and it would be nice to have a documentation page that explains the design goals of godot-cpp (and explains common pitfalls) so we can link to it, rather than writing a new explanation each time.

These include:

  • That one of the core design goals of godot-cpp is to have the same API (as much as is possible) as Godot modules, so we won't add new APIs to godot-cpp unless they are also added to Godot. Of course, we already have a number of API differences, but we're working on slowly fixing those, and adding new API differences would be counter productive
  • memnew() and Ref<T> need to be used when instantiating any Godot classes - plain C++ new or allocating them on the stack will not work
  • You can't use Godot types as global variables (if they are not allocated later on the heap). This is because they will be created before GDExtension has been initialized

Creating this issue so contributors can take on this task if they'd like :-)

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

No branches or pull requests

1 participant