Tokens

gdext.internal.register.Tokens
object Tokens

Encodes the small integer tokens that ClassRegistry hands to Godot as opaque CVoidPtrs (class_userdata, instance pointer) and back.

We deliberately stuff an integer id into the pointer slot rather than a real Scala-object address: the Scala objects are kept alive by the registry, and the GC never has to chase a fabricated pointer. Conversion is via the Scala Native intrinsics for raw-pointer/word casts.

Attributes

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

Members list

Value members

Concrete methods

inline def fromPtr(p: CVoidPtr): Long

Unpack a token id from a void pointer slot.

Unpack a token id from a void pointer slot.

Attributes

inline def toPtr(id: Long): CVoidPtr

Pack a token id into a void pointer slot.

Pack a token id into a void pointer slot.

Attributes