Skip to content

[GDExtension] Missing methods, classes and API discrepancies. #633

Open
@bruvzg

Description

@bruvzg

godot-cpp: ad11bbb5845a454551d490812631922c33b7601c
godot: godotengine/godot#52192

Some missing API functions and discrepancies found during attempt to port TextServerAdvanced to the GDExtension (as part of godotengine/godot#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:
  • Mutex and Semaphore:
  • 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 Port a bunch of Godot container templates to GDExtension. #701.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThis has been identified as a bugconfirmeddiscussiontopic:gdextensionThis relates to the new Godot 4 extension implementation

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions