[ocaml-ctypes] magical values in Tsdl

Florent Monnier monnier.florent at gmail.com
Tue Apr 30 14:46:58 BST 2019


Hi,

As an exercise I'm trying to add the new SDL_DisplayEvent struct that
appeared in the last SDL2 2.0.9 to tsdl:

diff -u SDL2-2.0.6/include/SDL_events.h SDL2-2.0.9/include/SDL_events.h
https://gist.github.com/fccm/a7a2739137b99ad75e271f04cae95a60

Here you can see my attempt as the git diff to the last tsdl git:
https://gist.github.com/fccm/99469a7ab436ef6a47927e5d1e6dda59

I tryed to follow the other events as example, and to add the new
display event, but I'm having difficulty to figure out how to write at
line 50:
let display_event = 0x150  (* compiles fine *)
that should probably be:
let display_event = sdl_displayevent
if I follow the other events there, like for example:
let window_event = sdl_windowevent  (* at line 4227 *)
let clipboard_update = sdl_clipboardupdate  (* at line 4011 *)
from:
https://github.com/dbuenzli/tsdl/blob/master/src/tsdl.ml

What I don't catch is where "sdl_windowevent" comes from?
Because if I write the equivalent:
let display_event = sdl_displayevent
I get:
Error: Unbound value sdl_displayevent

-- 
Regards
Florent


More information about the Ctypes mailing list