I'm using the ruby port of libtcod, which binds to the C functions. In particular, I'm trying to use this function:
tcod_function :TCOD_sys_check_for_event, [ :int, :pointer, :pointer ], :int
I'm doing so like this:
mouse = FFI::MemoryPointer.new(:int, 5)
keyboard = nil
event = TCOD.sys_check_for_event(TCOD::EVENT_ANY, keyboard, mouse)
(FYI, I'm just guessing at the size of the MemoryPointer, which may be my first problem. I'm not sure how to find the actual size it requires.)
My issue now is that I'm not sure how to get the information I need out of mouse
. The C for this function describes a beautiful looking tcod_mouse
, which I'd love to get access to.