text stringlengths 12 786k |
|---|
let _ = field joystick_guid " data8 " uint8_t |
let _ = field joystick_guid " data9 " uint8_t |
let _ = field joystick_guid " data10 " uint8_t |
let _ = field joystick_guid " data11 " uint8_t |
let _ = field joystick_guid " data12 " uint8_t |
let _ = field joystick_guid " data13 " uint8_t |
let _ = field joystick_guid " data14 " uint8_t |
let _ = field joystick_guid " data15 " uint8_t |
let ( ) = seal joystick_guid |
type joystick = unit ptr |
let joystick : joystick typ = ptr void |
let joystick_opt : joystick option typ = ptr_opt void |
let unsafe_joystick_of_ptr addr : joystick = ptr_of_raw_address addr |
let unsafe_ptr_of_joystick joystick = raw_address_of_ptr ( to_voidp joystick ) |
module Hat = struct type t = int let centered = sdl_hat_centered let up = sdl_hat_up let right = sdl_hat_right let down = sdl_hat_down let left = sdl_hat_left let rightup = sdl_hat_rightup let rightdown = sdl_hat_rightdown let leftup = sdl_hat_leftup let leftdown = sdl_hat_leftdown end |
module Joystick_power_level = struct type t = int let unknown = sdl_joystick_power_unknown let low = sdl_joystick_power_low let medium = sdl_joystick_power_medium let full = sdl_joystick_power_full let wired = sdl_joystick_power_wired let max = sdl_joystick_power_max end |
module Joystick_type = struct type t = int let unknown = sdl_joystick_type_unknown let gamecontroller = sdl_joystick_type_gamecontroller let wheel = sdl_joystick_type_wheel let arcade_stick = sdl_joystick_type_arcade_stick let flight_stick = sdl_joystick_type_flight_stick let dance_pad = sdl_joystick_type_dance... |
let joystick_close = foreign " SDL_JoystickClose " ( joystick @-> returning void ) |
let joystick_current_power_level = foreign " SDL_JoystickCurrentPowerLevel " ( joystick @-> returning int ) |
let joystick_event_state = foreign " SDL_JoystickEventState " ( int @-> returning nat_to_ok ) |
let joystick_from_instance_id = foreign " SDL_JoystickFromInstanceID " ( joystick_id @-> returning joystick ) |
let joystick_get_event_state ( ) = joystick_event_state sdl_query |
let joystick_set_event_state s = joystick_event_state s |
let joystick_get_attached = foreign " SDL_JoystickGetAttached " ( joystick @-> returning bool ) |
let joystick_get_axis = foreign " SDL_JoystickGetAxis " ( joystick @-> int @-> returning int16_t ) |
let joystick_get_axis_initial_state = foreign " SDL_JoystickGetAxisInitialState " ( joystick @-> int @-> returning int16_t ) |
let joystick_get_ball = foreign " SDL_JoystickGetBall " ( joystick @-> int @-> ( ptr int ) @-> ( ptr int ) @-> returning int ) |
let joystick_get_ball j i = let x = allocate int 0 in let y = allocate int 0 in match joystick_get_ball j i x y with | 0 -> Ok ( !@ x , !@ y ) | _ -> error ( ) |
let joystick_get_button = foreign " SDL_JoystickGetButton " ( joystick @-> int @-> returning int_as_uint8_t ) |
let joystick_get_device_guid = foreign " SDL_JoystickGetDeviceGUID " ( int @-> returning joystick_guid ) |
let joystick_get_device_product = foreign " SDL_JoystickGetDeviceProduct " ( int @-> returning int_as_uint16_t ) |
let joystick_get_device_product_version = foreign " SDL_JoystickGetDeviceProductVersion " ( int @-> returning int_as_uint16_t ) |
let joystick_get_device_type = foreign " SDL_JoystickGetDeviceType " ( int @-> returning int ) |
let joystick_get_device_instance_id = foreign " SDL_JoystickGetDeviceInstanceID " ( int @-> returning joystick_id ) |
let joystick_get_device_vendor = foreign " SDL_JoystickGetDeviceVendor " ( int @-> returning int_as_uint16_t ) |
let joystick_get_guid = foreign " SDL_JoystickGetGUID " ( joystick @-> returning joystick_guid ) |
let joystick_get_guid_from_string = foreign " SDL_JoystickGetGUIDFromString " ( string @-> returning joystick_guid ) |
let joystick_get_guid_string = foreign " SDL_JoystickGetGUIDString " ( joystick_guid @-> ptr char @-> int @-> returning void ) |
let joystick_get_guid_string guid = let len = 33 in let s = CArray . start ( CArray . make char 33 ) in joystick_get_guid_string guid s len ; coerce ( ptr char ) string s |
let joystick_get_hat = foreign " SDL_JoystickGetHat " ( joystick @-> int @-> returning int_as_uint8_t ) |
let joystick_get_product = foreign " SDL_JoystickGetProduct " ( joystick @-> returning int_as_uint16_t ) |
let joystick_get_product_version = foreign " SDL_JoystickGetProductVersion " ( joystick @-> returning int_as_uint16_t ) |
let joystick_get_type = foreign " SDL_JoystickGetType " ( joystick @-> returning int ) |
let joystick_get_vendor = foreign " SDL_JoystickGetVendor " ( joystick @-> returning int_as_uint16_t ) |
let joystick_instance_id = foreign " SDL_JoystickInstanceID " ( joystick @-> returning joystick_id ) |
let joystick_instance_id j = match joystick_instance_id j with | n when n < 0l -> error ( ) | n -> Ok n |
let joystick_name = foreign " SDL_JoystickName " ( joystick @-> returning ( some_to_ok string_opt ) ) |
let joystick_name_for_index = foreign " SDL_JoystickNameForIndex " ( int @-> returning ( some_to_ok string_opt ) ) |
let joystick_num_axes = foreign " SDL_JoystickNumAxes " ( joystick @-> returning nat_to_ok ) |
let joystick_num_balls = foreign " SDL_JoystickNumBalls " ( joystick @-> returning nat_to_ok ) |
let joystick_num_buttons = foreign " SDL_JoystickNumButtons " ( joystick @-> returning nat_to_ok ) |
let joystick_num_hats = foreign " SDL_JoystickNumHats " ( joystick @-> returning nat_to_ok ) |
let joystick_open = foreign " SDL_JoystickOpen " ( int @-> returning ( some_to_ok joystick_opt ) ) |
let joystick_update = foreign " SDL_JoystickUpdate " ( void @-> returning void ) |
let num_joysticks = foreign " SDL_NumJoysticks " ( void @-> returning nat_to_ok ) |
type game_controller = unit ptr |
let game_controller : game_controller typ = ptr void |
let game_controller_opt : game_controller option typ = ptr_opt void |
let unsafe_game_controller_of_ptr addr : game_controller = ptr_of_raw_address addr |
let unsafe_ptr_of_game_controller game_controller = raw_address_of_ptr ( to_voidp game_controller ) |
let button_bind : _button_bind structure typ = structure " SDL_GameControllerBindType " |
let button_bind_bind_type = field button_bind " bindType " int |
let button_bind_value1 = field button_bind " value1 " int |
let button_bind_value2 = field button_bind " value2 " int |
let ( ) = seal button_bind |
module Controller = struct type bind_type = int let bind_type_none = sdl_controller_bindtype_none let bind_type_button = sdl_controller_bindtype_button let bind_type_axis = sdl_controller_bindtype_axis let bind_type_hat = sdl_controller_bindtype_hat type axis = int let axis_invalid = sdl_controller_axis_invalid... |
let game_controller_add_mapping = foreign " SDL_GameControllerAddMapping " ( string @-> returning bool_to_ok ) |
let game_controller_add_mapping_from_file = foreign " SDL_GameControllerAddMappingsFromFile " ~ stub ( string @-> returning nat_to_ok ) |
let game_controller_add_mapping_from_rw = foreign " SDL_GameControllerAddMappingsFromRW " ~ stub ( rw_ops @-> bool @-> returning nat_to_ok ) |
let game_controller_close = foreign " SDL_GameControllerClose " ( game_controller @-> returning void ) |
let game_controller_event_state = foreign " SDL_GameControllerEventState " ( int @-> returning nat_to_ok ) |
let game_controller_from_instance_id = foreign " SDL_GameControllerFromInstanceID " ( joystick_id @-> returning game_controller ) |
let game_controller_get_event_state ( ) = game_controller_event_state sdl_query |
let game_controller_set_event_state t = game_controller_event_state t |
let game_controller_get_attached = foreign " SDL_GameControllerGetAttached " ( game_controller @-> returning bool ) |
let game_controller_get_axis = foreign " SDL_GameControllerGetAxis " ( game_controller @-> int @-> returning int16_t ) |
let game_controller_get_axis_from_string = foreign " SDL_GameControllerGetAxisFromString " ( string @-> returning int ) |
let game_controller_get_bind_for_axis = foreign " SDL_GameControllerGetBindForAxis " ( game_controller @-> int @-> returning button_bind ) |
let game_controller_get_bind_for_button = foreign " SDL_GameControllerGetBindForButton " ( game_controller @-> int @-> returning button_bind ) |
let game_controller_get_button = foreign " SDL_GameControllerGetButton " ( game_controller @-> int @-> returning int_as_uint8_t ) |
let game_controller_get_button_from_string = foreign " SDL_GameControllerGetButtonFromString " ( string @-> returning int ) |
let game_controller_get_joystick = foreign " SDL_GameControllerGetJoystick " ( game_controller @-> returning ( some_to_ok joystick_opt ) ) |
let game_controller_get_product = foreign " SDL_GameControllerGetProduct " ( game_controller @-> returning int_as_uint16_t ) |
let game_controller_get_product_version = foreign " SDL_GameControllerGetProductVersion " ( game_controller @-> returning int_as_uint16_t ) |
let game_controller_get_string_for_axis = foreign " SDL_GameControllerGetStringForAxis " ( int @-> returning string_opt ) |
let game_controller_get_string_for_button = foreign " SDL_GameControllerGetStringForButton " ( int @-> returning string_opt ) |
let game_controller_get_vendor = foreign " SDL_GameControllerGetVendor " ( game_controller @-> returning int_as_uint16_t ) |
let game_controller_mapping = foreign " SDL_GameControllerMapping " ( game_controller @-> returning ( some_to_ok string_opt ) ) |
let game_controller_mapping_for_index = foreign " SDL_GameControllerMappingForIndex " ( int @-> returning ( some_to_ok string_opt ) ) |
let game_controller_mapping_for_guid = foreign " SDL_GameControllerMappingForGUID " ( joystick_guid @-> returning ( some_to_ok string_opt ) ) |
let game_controller_name = foreign " SDL_GameControllerName " ( game_controller @-> returning ( some_to_ok string_opt ) ) |
let game_controller_name_for_index = foreign " SDL_GameControllerNameForIndex " ( int @-> returning ( some_to_ok string_opt ) ) |
let game_controller_num_mappings = foreign " SDL_GameControllerNumMappings " ( void @-> returning int ) |
let game_controller_open = foreign " SDL_GameControllerOpen " ( int @-> returning ( some_to_ok game_controller_opt ) ) |
let game_controller_update = foreign " SDL_GameControllerUpdate " ( void @-> returning void ) |
let is_game_controller = foreign " SDL_IsGameController " ( int @-> returning bool ) |
let event_type : event_type typ = int_as_uint32_t |
module Event = struct module Common = struct type t let t : t structure typ = structure " SDL_CommonEvent " let typ = field t " type " int_as_uint32_t let timestamp = field t " timestamp " int32_as_uint32_t let ( ) = seal t end module Controller_axis_event = struct type t let t : t structure ty... |
type event = Event . t union |
let event_state = foreign " SDL_EventState " ( event_type @-> int @-> returning int_as_uint8_t ) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.