godotengine / godotengine/godot-cpp

[GDExtension] Missing methods, classes and API discrepancies.

Open
#633 20 comments 1 reaction 0 assignees View on GitHub
bug confirmed discussion topic:gdextension
Dominant language
C++
Stars
2.7k
Forks
809
Avg merge
1d 3h
Merged PRs (30d)
8

Description

godot-cpp: `ad11bbb5845a454551d490812631922c33b7601c`
godot: https://github.com/godotengine/godot/pull/52192

Some missing API functions and discrepancies found during attempt to port `TextServerAdvanced` to the `GDExtension` (as part of https://github.com/godotengine/godot/pull/52192):

- ~`String`:~
- ~missing `ptr`, `ptrw` methods.~
- ~missing `+`, `+=` operators.~
- ~`StringName` do not expose `<` and `>` operators, and unusable as map key.~
- `Packed*Arrray`:
- ~missing `ptr`, `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`:
- ~no `is_valid` method.~
- ~no `RID_*_Owner` implementation, can be copy-pasted locally from the engine with minimal changes, but probably should be part of godot-cpp.~ Included in #701.
- `Mutex` and `Semaphore`:
- `lock` and `unlock` methods aren't `const`.
- ~no `MutexLock` class and `_THREAD_SAFE_` macros defined (can be added locally, but probably should be part of godot-cpp).~ Included in #701.
- ~`memnew`, `memdelete` aren't working with non-Godot classes.~
- ~no `memalloc`, `memfree` macros defined (can be added locally):~
```
#define memalloc(m_size) Memory::alloc_static(m_size)
#define memrealloc(m_mem, m_size) Memory::realloc_static(m_mem, m_size)
#define memfree(m_mem) Memory::free_static(m_mem)
```
- ~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 adding `GDVIRTUAL_NATIVE_PTR(Glyph *);` macro.~
- ~No templates for `Vector`, `Map`, `List`, `HashMap`, `Set`, not a critical issue, but would be convenient to have for better module <-> GDExtension portability.~ Included in #701.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.