Skip to content

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

Open
@dsnopek

Description

@dsnopek

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions