Skip to content
Discussion options

You must be logged in to vote

TraceLogCallback is exposing raylib’s native printf machinery, not a pre-formatted Java string.

Raylib declares the callback as void (*)(int logLevel, const char *text, va_list args) (header). In TraceLog, text is passed unchanged as the format string and the native va_list is passed separately. Jaylib therefore generates the third parameter as @ByVal @Cast("va_list*") Pointer (generated Javadoc).

That explains both symptoms:

  • %i is valid for C printf, but Java’s Formatter uses %d; more importantly, text is only the template, so replacing %i cannot recover the missing arguments.
  • Pointer args is an opaque, ABI-specific va_list. It has no type metadata, so reading it with getInt(), getLong(),…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Charadon
Comment options

Answer selected by Charadon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants