RT,简单来说,是一个突破性更改。GDExtension只能用来写插件(godot-cpp也只能用来写插件), GDExtension可以让插件和核心类无法区分
In the past month, the team has been hard at work introducing the new native extensions system for Godot 4.0. GDExtension is a new implementation of the GDNative layer that allows the creation of compiled plugins for the engine. At its core, GDExtension is a C API that enables registration of classes implemented within a dynamic library. This allows dynamic libraries to be used by Godot in a way that is much better integrated than its predecessor, GDNative. Together with the godot-cpp library, GDExtension introduces a system that allows extending Godot to nearly the same level as statically linked C++ modules can.
The new registration system is now part of Godot's ClassDB. This means that classes implemented in plugins are indistinguishable from core classes.
This is a breaking change to the system. GDNative plugins written for Godot 3 will not run on Godot 4 and vice versa. Plugins written for Godot 3 will need to be altered and compiled for Godot 4.
The logic for extensions within Godot itself has been fully merged into the branch.master
The branch in the godot-headers repository has been updated to contain the headers for GDExtension. An file that contains definition information about all the core classes accessible from extensions was also added. The branch in the godot-headers repository can be used for plugin development using the old GDNative API for Godot 3.masterextension_api.json3.x
The branch in the godot-cpp repository has also been updated with the new godot-cpp implementation for GDExtension. It can now only be used to develop plugins for Godot 4. As with godot-headers, use the branch when developing plugins for Godot 3.master3.x
In the past month, the team has been hard at work introducing the new native extensions system for Godot 4.0. GDExtension is a new implementation of the GDNative layer that allows the creation of compiled plugins for the engine. At its core, GDExtension is a C API that enables registration of classes implemented within a dynamic library. This allows dynamic libraries to be used by Godot in a way that is much better integrated than its predecessor, GDNative. Together with the godot-cpp library, GDExtension introduces a system that allows extending Godot to nearly the same level as statically linked C++ modules can.
The new registration system is now part of Godot's ClassDB. This means that classes implemented in plugins are indistinguishable from core classes.
This is a breaking change to the system. GDNative plugins written for Godot 3 will not run on Godot 4 and vice versa. Plugins written for Godot 3 will need to be altered and compiled for Godot 4.
The logic for extensions within Godot itself has been fully merged into the branch.master
The branch in the godot-headers repository has been updated to contain the headers for GDExtension. An file that contains definition information about all the core classes accessible from extensions was also added. The branch in the godot-headers repository can be used for plugin development using the old GDNative API for Godot 3.masterextension_api.json3.x
The branch in the godot-cpp repository has also been updated with the new godot-cpp implementation for GDExtension. It can now only be used to develop plugins for Godot 4. As with godot-headers, use the branch when developing plugins for Godot 3.master3.x