-
-
Notifications
You must be signed in to change notification settings - Fork 586
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
[GDExtension] Missing methods, classes and API discrepancies. #633
Comments
Most of the discrepancy in core classes comes from the fact that GDExtension uses the API registered in I ran into most of the above too when attempting to port the
I also had issues with a class extending Also related, using the |
For these ones I believe they should stop being used. In C++ max/min/clamp already exist as inline templates in
Such shortcuts shouldn't need to exist IMO, at least not globally. It's a 2-letter macro whose sole purpose is shortening something that isn't that long and not used often (depends of the area of course), and being explicit would be much better. If the singleton is repeated a lot then it can be placed in a local reference. |
I use those all the time in https://github.com/goostengine/goost, even templates like
|
The ClassDB object allows for registering but doesn't give access to any of its methods as defined in the version GDscript has access to: https://docs.godotengine.org/en/latest/classes/class_classdb.html |
Another method of String that went missing in GDExtension:
EDIT: Also, I can't seem to find an equivalent to the |
There's no such method in the Godot ether, what's it supposed to do?
This is fixed. Updated the first comment, most of the stuff in the original issue is already fixed, or (in case of templates) will be added by #701 |
It's supposed to be an easy way of converting a Godot String to a char*. char *String::alloc_c_string() const {
godot_char_string contents = godot::api->godot_string_utf8(&_godot_string);
int length = godot::api->godot_char_string_length(&contents);
char *result = (char *)godot::api->godot_alloc(length + 1);
if (result) {
memcpy(result, godot::api->godot_char_string_get_data(&contents), length + 1);
}
godot::api->godot_char_string_destroy(&contents);
return result;
} |
With the new GDextension API you can do something like this instead (and int size = internal::gdn_interface->string_to_utf8_chars(string, nullptr, 0);
char *cstr = memnew_arr(char, size + 1);
internal::gdn_interface->string_to_utf8_chars(string, cstr, size + 1); |
In Godot's source code, that method also takes an One reason I know For consistency however it would be valid to use |
This issue mentions |
Dont the strokes mean "done"? |
It it means "done", then it is wrongly crossed out:
|
It means "done", but it's done it the godotengine/godot#58233, which is not merged. |
I'm using the latest master commit (eaaf941) and using += to add two godot Strings together isn't accepted yet... :/ (Event though godotengine/godot#58233) has now been merged and been included in the latest Godot 4.0 Alpha 9. |
@DmitriySalnikov None of Callable's vararg methods are implemented #802 |
Implement by #936. |
I'm not sure if this should be considered a bug or an API discrepancy, but In core, In godot-cpp, there is no However, EDIT: I ended up making a PR for it: #961 |
|
godot-cpp:
ad11bbb5845a454551d490812631922c33b7601c
godot: godotengine/godot#52192
Some missing API functions and discrepancies found during attempt to port
TextServerAdvanced
to theGDExtension
(as part of godotengine/godot#52192):String
:missingptr
,ptrw
methods.missing+
,+=
operators.StringName
do not expose<
and>
operators, and unusable as map key.Packed*Arrray
:missingptr
,ptrw
methods.[]
operator API difference with the engine ([]
vs.write[]
).Dictionary
:missing[]
operator.seems to have no methods to write value at all.Char*String
:no public constructors.RID
:nois_valid
method.noIncluded in Port a bunch of Godot container templates to GDExtension. #701.RID_*_Owner
implementation, can be copy-pasted locally from the engine with minimal changes, but probably should be part of godot-cpp.Mutex
andSemaphore
:lock
andunlock
methods aren'tconst
.noIncluded in Port a bunch of Godot container templates to GDExtension. #701.MutexLock
class and_THREAD_SAFE_
macros defined (can be added locally, but probably should be part of godot-cpp).memnew
,memdelete
aren't working with non-Godot classes.nomemalloc
,memfree
macros defined (can be added locally):Enum type return values can't be bound on the engine side.Enum type argument types can't be bound, unless conversion macros is added manually-MAKE_PTRARGCONV(TextServer::Direction, int64_t);
.Missing math defines,MAX
,MIN
,CLAMP
etc.No conversion for custom native pointer types, can be fixed locally by addingGDVIRTUAL_NATIVE_PTR(Glyph *);
macro.No templates forIncluded in Port a bunch of Godot container templates to GDExtension. #701.Vector
,Map
,List
,HashMap
,Set
, not a critical issue, but would be convenient to have for better module <-> GDExtension portability.The text was updated successfully, but these errors were encountered: