Skip to content
squid233 edited this page Dec 30, 2024 · 11 revisions

OverrunGL is designed based on Java FFM API.

C Types -> Java Types

MemoryLayouts describes a carrier and the byte size of a type.

The types in the table this below can be directly converted from/to C.

Value Layout Java Type C/C++ Type
JAVA_BYTE byte char
JAVA_SHORT short short
JAVA_INT int int
JAVA_LONG long long long
JAVA_CHAR char short
JAVA_BOOLEAN boolean char/bool
JAVA_FLOAT float float
JAVA_DOUBLE double double
ADDRESS MemorySegment void*

Any pointer types can be directly converted to MemorySegment even if it is a pointer of struct or other pointers of pointer.

✔️ int*
✔️ my_struct*
✔️ void**
✔️ other_struct***

Return values whose memory layout is ValueLayout.ADDRESS with target layout will be reinterpreted to correspoding size.

Clone this wiki locally