racket-sdl
racket-sdl copied to clipboard
SDL_AddTimer segfault
Hello! I can't figure how to use SDL_AddTimer. The problem seems to be in the callback parameter. When I pass simple lambda, it segfaults:
racket
Welcome to Racket v7.1.
> (require sdl)
> (SDL_Init SDL_INIT_TIMER)
> (SDL_AddTimer 1 (lambda (interval dummy) #f) #f)
SIGSEGV MAPERR si_code 1 fault on addr 0x390
zsh: abort (core dumped) racket
When I try to pass #f as callback. it segfaults at addr (nil). When I try to convert callback to some other type, racket complains that it expects procedure?.
I'm not fluent in Racket FFI, so the question is how do I correctly pass callback? Am I missing something?