Wrappers

gdext.internal.engine.Wrappers
object Wrappers

One Scala wrapper per engine object, cached on the object itself through Godot's instance bindings (the godot-cpp mechanism).

The first time an object is wrapped, Godot calls createCallback: it returns the object's bound user instance if it has one, else a fresh wrapper of the object's most-derived generated class (gdext.classes.ClassFactory). Later wraps are a single object_get_instance_binding call: no allocation, and the same wrapper every time. When the engine frees the object, Godot calls freeCallback, which clears the wrapper's handle, so calling a method on it throws instead of touching freed memory.

The binding is a gdext.internal.SlotTable token, never a raw Scala address, so the GC always sees the wrapper through the table.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Wrappers.type

Members list

Value members

Concrete methods

def at(addr: Long): GodotScriptClass

The wrapper for the engine object at address addr (0 for none). Takes the address, not a Ptr, so the call does not box (see Addr).

The wrapper for the engine object at address addr (0 for none). Takes the address, not a Ptr, so the call does not box (see Addr).

Attributes

Make scala (a just-bound user instance) the wrapper for obj, so wraps of obj return it directly.

Make scala (a just-bound user instance) the wrapper for obj, so wraps of obj return it directly.

Attributes

inline def borrowed[T <: GodotScriptClass](addr: Long): T

The typed wrapper for a borrowed Object* return (its address).

The typed wrapper for a borrowed Object* return (its address).

Attributes

inline def borrowed[T <: GodotScriptClass](o: GodotObject): T

The typed wrapper for a borrowed object handle.

The typed wrapper for a borrowed object handle.

Attributes

The engine handle to pass for an object argument (null passes null).

The engine handle to pass for an object argument (null passes null).

Attributes

The wrapper for engine object p (null for a null handle).

The wrapper for engine object p (null for a null handle).

Attributes

inline def owned[T <: GodotScriptClass](addr: Long): T

The typed wrapper for a Ref<T> return (its address): the engine handed over one reference, which the wrapper now owns (see Ownership).

The typed wrapper for a Ref<T> return (its address): the engine handed over one reference, which the wrapper now owns (see Ownership).

Attributes