#How to do Printf style logging from a "c" procedure?

1 messages · Page 1 of 1 (latest)

deft mason
#

I have some code like this:

glfw_character_callback :: proc "c" (window: glfw.WindowHandle, r: rune) {
    if (inputted_runes_count >= len(inputted_runes)) {
        fmt.println("WARNING - text buffer is full")
        return
    }

    inputted_runes[inputted_runes_count] = r
    inputted_runes_count += 1
}

The compiler is telling me 'context' has not been defined within this scope, but is required for this procedure call, probably because of the 'c' calling convention instead of the default odin one with the context pointer. Are there any other ways to do this kind of logging? Or is there a way to create an odin context for this one printf call?

prime vapor