Module: SDL

Extended by:
FFI::Library
Defined in:
lib/sdl2.rb,
lib/sdl2_log.rb,
lib/sdl2_ttf.rb,
lib/sdl2_guid.rb,
lib/sdl2_main.rb,
lib/sdl2_misc.rb,
lib/sdl2_rect.rb,
lib/sdl2_audio.rb,
lib/sdl2_error.rb,
lib/sdl2_hints.rb,
lib/sdl2_image.rb,
lib/sdl2_mixer.rb,
lib/sdl2_mouse.rb,
lib/sdl2_power.rb,
lib/sdl2_rwops.rb,
lib/sdl2_shape.rb,
lib/sdl2_sound.rb,
lib/sdl2_syswm.rb,
lib/sdl2_timer.rb,
lib/sdl2_touch.rb,
lib/sdl2_video.rb,
lib/sdl2_events.rb,
lib/sdl2_haptic.rb,
lib/sdl2_hidapi.rb,
lib/sdl2_pixels.rb,
lib/sdl2_render.rb,
lib/sdl2_sensor.rb,
lib/sdl2_stdinc.rb,
lib/sdl2_vulkan.rb,
lib/sdl2_cpuinfo.rb,
lib/sdl2_gesture.rb,
lib/sdl2_keycode.rb,
lib/sdl2_surface.rb,
lib/sdl2_version.rb,
lib/sdl2_joystick.rb,
lib/sdl2_keyboard.rb,
lib/sdl2_platform.rb,
lib/sdl2_rotozoom.rb,
lib/sdl2_scancode.rb,
lib/sdl2_blendmode.rb,
lib/sdl2_clipboard.rb,
lib/sdl2_framerate.rb,
lib/sdl2_filesystem.rb,
lib/sdl2_messagebox.rb,
lib/sdl2_imageFilter.rb,
lib/sdl2_gfxPrimitives.rb,
lib/sdl2_gamecontroller.rb

Defined Under Namespace

Classes: AudioCVT, AudioDeviceEvent, AudioSpec, Color, CommonEvent, ControllerAxisEvent, ControllerButtonEvent, ControllerDeviceEvent, ControllerSensorEvent, ControllerTouchpadEvent, Default_RWops, Default_RWops_hidden, DisplayEvent, DisplayMode, DollarGestureEvent, DropEvent, Event, FPSmanager, FPoint, FRect, Finger, GUID, GameControllerButtonBind, GameControllerButtonBind_value, GameControllerButtonBind_value_hat, HapticCondition, HapticConstant, HapticCustom, HapticDirection, HapticEffect, HapticLeftRight, HapticPeriodic, HapticRamp, Hid_device_info, IMG_Animation, JoyAxisEvent, JoyBallEvent, JoyBatteryEvent, JoyButtonEvent, JoyDeviceEvent, JoyHatEvent, KeyboardEvent, Keysym, MessageBoxButtonData, MessageBoxColor, MessageBoxColorScheme, MessageBoxData, Mix_Chunk, MouseButtonEvent, MouseMotionEvent, MouseWheelEvent, MultiGestureEvent, Palette, PixelFormat, Point, QuitEvent, RWops_mem, RWops_unknown, RWops_windowsio, RWops_windowsio_buffer, Rect, RendererInfo, SensorEvent, Sound_AudioInfo, Sound_DecoderInfo, Sound_Sample, Sound_Version, Surface, SysWMEvent, SysWMinfo_cocoa, SysWMinfo_def_cocoa, SysWMinfo_def_win, SysWMinfo_def_wl, SysWMinfo_def_x11, SysWMinfo_value_cocoa, SysWMinfo_value_win, SysWMinfo_value_wl, SysWMinfo_value_x11, SysWMinfo_win, SysWMinfo_wl, SysWMinfo_x11, SysWMmsg_cocoa, SysWMmsg_def_cocoa, SysWMmsg_def_win, SysWMmsg_def_x11, SysWMmsg_value_cocoa, SysWMmsg_value_win, SysWMmsg_value_x11, SysWMmsg_win, SysWMmsg_x11, TextEditingEvent, TextEditingExtEvent, TextInputEvent, TouchFingerEvent, UserEvent, Version, Vertex, VirtualJoystickDesc, Win32_RWops, Win32_RWops_hidden, WindowEvent, WindowShapeMode, WindowShapeParams

Constant Summary collapse

MAX_LOG_MESSAGE =

Define/Macro

4096
LOG_CATEGORY_APPLICATION =

Enum

0
LOG_CATEGORY_ERROR =
1
LOG_CATEGORY_ASSERT =
2
LOG_CATEGORY_SYSTEM =
3
LOG_CATEGORY_AUDIO =
4
LOG_CATEGORY_VIDEO =
5
LOG_CATEGORY_RENDER =
6
LOG_CATEGORY_INPUT =
7
LOG_CATEGORY_TEST =
8
LOG_CATEGORY_RESERVED1 =
9
LOG_CATEGORY_RESERVED2 =
10
LOG_CATEGORY_RESERVED3 =
11
LOG_CATEGORY_RESERVED4 =
12
LOG_CATEGORY_RESERVED5 =
13
LOG_CATEGORY_RESERVED6 =
14
LOG_CATEGORY_RESERVED7 =
15
LOG_CATEGORY_RESERVED8 =
16
LOG_CATEGORY_RESERVED9 =
17
LOG_CATEGORY_RESERVED10 =
18
LOG_CATEGORY_CUSTOM =
19
LOG_PRIORITY_VERBOSE =
1
LOG_PRIORITY_DEBUG =
2
LOG_PRIORITY_INFO =
3
LOG_PRIORITY_WARN =
4
LOG_PRIORITY_ERROR =
5
LOG_PRIORITY_CRITICAL =
6
NUM_LOG_PRIORITIES =
7
TTF_MAJOR_VERSION =

Define/Macro

2
TTF_MINOR_VERSION =
22
TTF_PATCHLEVEL =
0
TTF_STYLE_NORMAL =
0x00
TTF_STYLE_BOLD =
0x01
TTF_STYLE_ITALIC =
0x02
TTF_STYLE_UNDERLINE =
0x04
TTF_STYLE_STRIKETHROUGH =
0x08
TTF_HINTING_NORMAL =
0
TTF_HINTING_LIGHT =
1
TTF_HINTING_MONO =
2
TTF_HINTING_NONE =
3
TTF_HINTING_LIGHT_SUBPIXEL =
4
TTF_WRAPPED_ALIGN_LEFT =
0
TTF_WRAPPED_ALIGN_CENTER =
1
TTF_WRAPPED_ALIGN_RIGHT =
2
TTF_DIRECTION_LTR =

Enum

0
TTF_DIRECTION_RTL =
1
TTF_DIRECTION_TTB =
2
TTF_DIRECTION_BTT =
3
INIT_TIMER =

Define/Macro

0x00000001
INIT_AUDIO =
0x00000010
INIT_VIDEO =
0x00000020
INIT_JOYSTICK =
0x00000200
INIT_HAPTIC =
0x00001000
INIT_GAMECONTROLLER =
0x00002000
INIT_EVENTS =
0x00004000
INIT_SENSOR =
0x00008000
INIT_NOPARACHUTE =
0x00100000
INIT_EVERYTHING =
( INIT_TIMER | INIT_AUDIO | INIT_VIDEO | INIT_EVENTS | INIT_JOYSTICK | INIT_HAPTIC | INIT_GAMECONTROLLER | INIT_SENSOR )
AUDIO_MASK_BITSIZE =

Define/Macro

0xFF
AUDIO_MASK_DATATYPE =
(1 << 8)
AUDIO_MASK_ENDIAN =
(1 << 12)
AUDIO_MASK_SIGNED =
(1 << 15)
AUDIO_U8 =
0x0008
AUDIO_S8 =
0x8008
AUDIO_U16LSB =
0x0010
AUDIO_S16LSB =
0x8010
AUDIO_U16MSB =
0x1010
AUDIO_S16MSB =
0x9010
AUDIO_U16 =
AUDIO_U16LSB
AUDIO_S16 =
AUDIO_S16LSB
AUDIO_S32LSB =
0x8020
AUDIO_S32MSB =
0x9020
AUDIO_S32 =
AUDIO_S32LSB
AUDIO_F32LSB =
0x8120
AUDIO_F32MSB =
0x9120
AUDIO_F32 =
AUDIO_F32LSB
AUDIO_U16SYS =
AUDIO_U16LSB
AUDIO_S16SYS =
AUDIO_S16LSB
AUDIO_S32SYS =
AUDIO_S32LSB
AUDIO_F32SYS =
AUDIO_F32LSB
AUDIO_ALLOW_FREQUENCY_CHANGE =
0x00000001
AUDIO_ALLOW_FORMAT_CHANGE =
0x00000002
AUDIO_ALLOW_CHANNELS_CHANGE =
0x00000004
AUDIO_ALLOW_SAMPLES_CHANGE =
0x00000008
AUDIO_ALLOW_ANY_CHANGE =
(AUDIO_ALLOW_FREQUENCY_CHANGE | AUDIO_ALLOW_FORMAT_CHANGE | AUDIO_ALLOW_CHANNELS_CHANGE | AUDIO_ALLOW_SAMPLES_CHANGE)
AUDIOCVT_MAX_FILTERS =
9
MIX_MAXVOLUME =
128
AUDIO_STOPPED =

Enum

0
AUDIO_PLAYING =
1
AUDIO_PAUSED =
2
ENOMEM =

Enum

0
EFREAD =
1
EFWRITE =
2
EFSEEK =
3
UNSUPPORTED =
4
LASTERROR =
5
HINT_ACCELEROMETER_AS_JOYSTICK =

Define/Macro

"SDL_ACCELEROMETER_AS_JOYSTICK"
HINT_ALLOW_ALT_TAB_WHILE_GRABBED =
"SDL_ALLOW_ALT_TAB_WHILE_GRABBED"
HINT_ALLOW_TOPMOST =
"SDL_ALLOW_TOPMOST"
HINT_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION =
"SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"
HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION =
"SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
HINT_ANDROID_BLOCK_ON_PAUSE =
"SDL_ANDROID_BLOCK_ON_PAUSE"
HINT_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO =
"SDL_ANDROID_BLOCK_ON_PAUSE_PAUSEAUDIO"
HINT_ANDROID_TRAP_BACK_BUTTON =
"SDL_ANDROID_TRAP_BACK_BUTTON"
HINT_APP_NAME =
"SDL_APP_NAME"
HINT_APPLE_TV_CONTROLLER_UI_EVENTS =
"SDL_APPLE_TV_CONTROLLER_UI_EVENTS"
HINT_APPLE_TV_REMOTE_ALLOW_ROTATION =
"SDL_APPLE_TV_REMOTE_ALLOW_ROTATION"
HINT_AUDIO_CATEGORY =
"SDL_AUDIO_CATEGORY"
HINT_AUDIO_DEVICE_APP_NAME =
"SDL_AUDIO_DEVICE_APP_NAME"
HINT_AUDIO_DEVICE_STREAM_NAME =
"SDL_AUDIO_DEVICE_STREAM_NAME"
HINT_AUDIO_DEVICE_STREAM_ROLE =
"SDL_AUDIO_DEVICE_STREAM_ROLE"
HINT_AUDIO_RESAMPLING_MODE =
"SDL_AUDIO_RESAMPLING_MODE"
HINT_AUTO_UPDATE_JOYSTICKS =
"SDL_AUTO_UPDATE_JOYSTICKS"
HINT_AUTO_UPDATE_SENSORS =
"SDL_AUTO_UPDATE_SENSORS"
HINT_BMP_SAVE_LEGACY_FORMAT =
"SDL_BMP_SAVE_LEGACY_FORMAT"
HINT_DISPLAY_USABLE_BOUNDS =
"SDL_DISPLAY_USABLE_BOUNDS"
HINT_EMSCRIPTEN_ASYNCIFY =
"SDL_EMSCRIPTEN_ASYNCIFY"
HINT_EMSCRIPTEN_KEYBOARD_ELEMENT =
"SDL_EMSCRIPTEN_KEYBOARD_ELEMENT"
HINT_ENABLE_SCREEN_KEYBOARD =
"SDL_ENABLE_SCREEN_KEYBOARD"
HINT_ENABLE_STEAM_CONTROLLERS =
"SDL_ENABLE_STEAM_CONTROLLERS"
HINT_EVENT_LOGGING =
"SDL_EVENT_LOGGING"
HINT_FORCE_RAISEWINDOW =
"SDL_HINT_FORCE_RAISEWINDOW"
HINT_FRAMEBUFFER_ACCELERATION =
"SDL_FRAMEBUFFER_ACCELERATION"
HINT_GAMECONTROLLERCONFIG =
"SDL_GAMECONTROLLERCONFIG"
HINT_GAMECONTROLLERCONFIG_FILE =
"SDL_GAMECONTROLLERCONFIG_FILE"
HINT_GAMECONTROLLERTYPE =
"SDL_GAMECONTROLLERTYPE"
HINT_GAMECONTROLLER_IGNORE_DEVICES =
"SDL_GAMECONTROLLER_IGNORE_DEVICES"
HINT_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT =
"SDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT"
HINT_GAMECONTROLLER_USE_BUTTON_LABELS =
"SDL_GAMECONTROLLER_USE_BUTTON_LABELS"
HINT_GRAB_KEYBOARD =
"SDL_GRAB_KEYBOARD"
HINT_HIDAPI_IGNORE_DEVICES =
"SDL_HIDAPI_IGNORE_DEVICES"
HINT_IDLE_TIMER_DISABLED =
"SDL_IOS_IDLE_TIMER_DISABLED"
HINT_IME_INTERNAL_EDITING =
"SDL_IME_INTERNAL_EDITING"
HINT_IME_SHOW_UI =
"SDL_IME_SHOW_UI"
HINT_IME_SUPPORT_EXTENDED_TEXT =
"SDL_IME_SUPPORT_EXTENDED_TEXT"
HINT_IOS_HIDE_HOME_INDICATOR =
"SDL_IOS_HIDE_HOME_INDICATOR"
HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS =
"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS"
HINT_JOYSTICK_ARCADESTICK_DEVICES =
"SDL_JOYSTICK_ARCADESTICK_DEVICES"
HINT_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED =
"SDL_JOYSTICK_ARCADESTICK_DEVICES_EXCLUDED"
HINT_JOYSTICK_BLACKLIST_DEVICES =
"SDL_JOYSTICK_BLACKLIST_DEVICES"
HINT_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED =
"SDL_JOYSTICK_BLACKLIST_DEVICES_EXCLUDED"
HINT_JOYSTICK_FLIGHTSTICK_DEVICES =
"SDL_JOYSTICK_FLIGHTSTICK_DEVICES"
HINT_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED =
"SDL_JOYSTICK_FLIGHTSTICK_DEVICES_EXCLUDED"
HINT_JOYSTICK_GAMECUBE_DEVICES =
"SDL_JOYSTICK_GAMECUBE_DEVICES"
HINT_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED =
"SDL_JOYSTICK_GAMECUBE_DEVICES_EXCLUDED"
HINT_JOYSTICK_HIDAPI =
"SDL_JOYSTICK_HIDAPI"
HINT_JOYSTICK_HIDAPI_GAMECUBE =
"SDL_JOYSTICK_HIDAPI_GAMECUBE"
HINT_JOYSTICK_GAMECUBE_RUMBLE_BRAKE =
"SDL_JOYSTICK_GAMECUBE_RUMBLE_BRAKE"
HINT_JOYSTICK_HIDAPI_JOY_CONS =
"SDL_JOYSTICK_HIDAPI_JOY_CONS"
HINT_JOYSTICK_HIDAPI_COMBINE_JOY_CONS =
"SDL_JOYSTICK_HIDAPI_COMBINE_JOY_CONS"
HINT_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS =
"SDL_JOYSTICK_HIDAPI_VERTICAL_JOY_CONS"
HINT_JOYSTICK_HIDAPI_LUNA =
"SDL_JOYSTICK_HIDAPI_LUNA"
HINT_JOYSTICK_HIDAPI_NINTENDO_CLASSIC =
"SDL_JOYSTICK_HIDAPI_NINTENDO_CLASSIC"
HINT_JOYSTICK_HIDAPI_SHIELD =
"SDL_JOYSTICK_HIDAPI_SHIELD"
HINT_JOYSTICK_HIDAPI_PS3 =
"SDL_JOYSTICK_HIDAPI_PS3"
HINT_JOYSTICK_HIDAPI_PS4 =
"SDL_JOYSTICK_HIDAPI_PS4"
HINT_JOYSTICK_HIDAPI_PS4_RUMBLE =
"SDL_JOYSTICK_HIDAPI_PS4_RUMBLE"
HINT_JOYSTICK_HIDAPI_PS5 =
"SDL_JOYSTICK_HIDAPI_PS5"
HINT_JOYSTICK_HIDAPI_PS5_PLAYER_LED =
"SDL_JOYSTICK_HIDAPI_PS5_PLAYER_LED"
HINT_JOYSTICK_HIDAPI_PS5_RUMBLE =
"SDL_JOYSTICK_HIDAPI_PS5_RUMBLE"
HINT_JOYSTICK_HIDAPI_STADIA =
"SDL_JOYSTICK_HIDAPI_STADIA"
HINT_JOYSTICK_HIDAPI_STEAM =
"SDL_JOYSTICK_HIDAPI_STEAM"
HINT_JOYSTICK_HIDAPI_STEAMDECK =
"SDL_JOYSTICK_HIDAPI_STEAMDECK"
HINT_JOYSTICK_HIDAPI_SWITCH =
"SDL_JOYSTICK_HIDAPI_SWITCH"
HINT_JOYSTICK_HIDAPI_SWITCH_HOME_LED =
"SDL_JOYSTICK_HIDAPI_SWITCH_HOME_LED"
HINT_JOYSTICK_HIDAPI_JOYCON_HOME_LED =
"SDL_JOYSTICK_HIDAPI_JOYCON_HOME_LED"
HINT_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED =
"SDL_JOYSTICK_HIDAPI_SWITCH_PLAYER_LED"
HINT_JOYSTICK_HIDAPI_WII =
"SDL_JOYSTICK_HIDAPI_WII"
HINT_JOYSTICK_HIDAPI_WII_PLAYER_LED =
"SDL_JOYSTICK_HIDAPI_WII_PLAYER_LED"
HINT_JOYSTICK_HIDAPI_XBOX =
"SDL_JOYSTICK_HIDAPI_XBOX"
HINT_JOYSTICK_HIDAPI_XBOX_360 =
"SDL_JOYSTICK_HIDAPI_XBOX_360"
HINT_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED =
"SDL_JOYSTICK_HIDAPI_XBOX_360_PLAYER_LED"
HINT_JOYSTICK_HIDAPI_XBOX_360_WIRELESS =
"SDL_JOYSTICK_HIDAPI_XBOX_360_WIRELESS"
HINT_JOYSTICK_HIDAPI_XBOX_ONE =
"SDL_JOYSTICK_HIDAPI_XBOX_ONE"
HINT_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED =
"SDL_JOYSTICK_HIDAPI_XBOX_ONE_HOME_LED"
HINT_JOYSTICK_IOKIT =
"SDL_JOYSTICK_IOKIT"
HINT_JOYSTICK_MFI =
"SDL_JOYSTICK_MFI"
HINT_JOYSTICK_RAWINPUT =
"SDL_JOYSTICK_RAWINPUT"
HINT_JOYSTICK_RAWINPUT_CORRELATE_XINPUT =
"SDL_JOYSTICK_RAWINPUT_CORRELATE_XINPUT"
HINT_JOYSTICK_ROG_CHAKRAM =
"SDL_JOYSTICK_ROG_CHAKRAM"
HINT_JOYSTICK_THREAD =
"SDL_JOYSTICK_THREAD"
HINT_JOYSTICK_THROTTLE_DEVICES =
"SDL_JOYSTICK_THROTTLE_DEVICES"
HINT_JOYSTICK_THROTTLE_DEVICES_EXCLUDED =
"SDL_JOYSTICK_THROTTLE_DEVICES_EXCLUDED"
HINT_JOYSTICK_WGI =
"SDL_JOYSTICK_WGI"
HINT_JOYSTICK_WHEEL_DEVICES =
"SDL_JOYSTICK_WHEEL_DEVICES"
HINT_JOYSTICK_WHEEL_DEVICES_EXCLUDED =
"SDL_JOYSTICK_WHEEL_DEVICES_EXCLUDED"
HINT_JOYSTICK_ZERO_CENTERED_DEVICES =
"SDL_JOYSTICK_ZERO_CENTERED_DEVICES"
HINT_KMSDRM_REQUIRE_DRM_MASTER =
"SDL_KMSDRM_REQUIRE_DRM_MASTER"
HINT_JOYSTICK_DEVICE =
"SDL_JOYSTICK_DEVICE"
HINT_LINUX_DIGITAL_HATS =
"SDL_LINUX_DIGITAL_HATS"
HINT_LINUX_HAT_DEADZONES =
"SDL_LINUX_HAT_DEADZONES"
HINT_LINUX_JOYSTICK_CLASSIC =
"SDL_LINUX_JOYSTICK_CLASSIC"
HINT_LINUX_JOYSTICK_DEADZONES =
"SDL_LINUX_JOYSTICK_DEADZONES"
HINT_LOGGING =
"SDL_LOGGING"
HINT_MAC_BACKGROUND_APP =
"SDL_MAC_BACKGROUND_APP"
HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK =
"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK"
HINT_MAC_OPENGL_ASYNC_DISPATCH =
"SDL_MAC_OPENGL_ASYNC_DISPATCH"
HINT_MOUSE_DOUBLE_CLICK_RADIUS =
"SDL_MOUSE_DOUBLE_CLICK_RADIUS"
HINT_MOUSE_DOUBLE_CLICK_TIME =
"SDL_MOUSE_DOUBLE_CLICK_TIME"
HINT_MOUSE_FOCUS_CLICKTHROUGH =
"SDL_MOUSE_FOCUS_CLICKTHROUGH"
HINT_MOUSE_NORMAL_SPEED_SCALE =
"SDL_MOUSE_NORMAL_SPEED_SCALE"
HINT_MOUSE_RELATIVE_MODE_CENTER =
"SDL_MOUSE_RELATIVE_MODE_CENTER"
HINT_MOUSE_RELATIVE_MODE_WARP =
"SDL_MOUSE_RELATIVE_MODE_WARP"
HINT_MOUSE_RELATIVE_SCALING =
"SDL_MOUSE_RELATIVE_SCALING"
HINT_MOUSE_RELATIVE_SPEED_SCALE =
"SDL_MOUSE_RELATIVE_SPEED_SCALE"
HINT_MOUSE_RELATIVE_SYSTEM_SCALE =
"SDL_MOUSE_RELATIVE_SYSTEM_SCALE"
HINT_MOUSE_RELATIVE_WARP_MOTION =
"SDL_MOUSE_RELATIVE_WARP_MOTION"
HINT_MOUSE_TOUCH_EVENTS =
"SDL_MOUSE_TOUCH_EVENTS"
HINT_MOUSE_AUTO_CAPTURE =
"SDL_MOUSE_AUTO_CAPTURE"
HINT_NO_SIGNAL_HANDLERS =
"SDL_NO_SIGNAL_HANDLERS"
HINT_OPENGL_ES_DRIVER =
"SDL_OPENGL_ES_DRIVER"
HINT_ORIENTATIONS =
"SDL_IOS_ORIENTATIONS"
HINT_POLL_SENTINEL =
"SDL_POLL_SENTINEL"
HINT_PREFERRED_LOCALES =
"SDL_PREFERRED_LOCALES"
HINT_QTWAYLAND_CONTENT_ORIENTATION =
"SDL_QTWAYLAND_CONTENT_ORIENTATION"
HINT_QTWAYLAND_WINDOW_FLAGS =
"SDL_QTWAYLAND_WINDOW_FLAGS"
HINT_RENDER_BATCHING =
"SDL_RENDER_BATCHING"
HINT_RENDER_LINE_METHOD =
"SDL_RENDER_LINE_METHOD"
HINT_RENDER_DIRECT3D11_DEBUG =
"SDL_RENDER_DIRECT3D11_DEBUG"
HINT_RENDER_DIRECT3D_THREADSAFE =
"SDL_RENDER_DIRECT3D_THREADSAFE"
HINT_RENDER_DRIVER =
"SDL_RENDER_DRIVER"
HINT_RENDER_LOGICAL_SIZE_MODE =
"SDL_RENDER_LOGICAL_SIZE_MODE"
HINT_RENDER_OPENGL_SHADERS =
"SDL_RENDER_OPENGL_SHADERS"
HINT_RENDER_SCALE_QUALITY =
"SDL_RENDER_SCALE_QUALITY"
HINT_RENDER_VSYNC =
"SDL_RENDER_VSYNC"
HINT_RENDER_METAL_PREFER_LOW_POWER_DEVICE =
"SDL_RENDER_METAL_PREFER_LOW_POWER_DEVICE"
HINT_ROG_GAMEPAD_MICE =
"SDL_ROG_GAMEPAD_MICE"
HINT_ROG_GAMEPAD_MICE_EXCLUDED =
"SDL_ROG_GAMEPAD_MICE_EXCLUDED"
HINT_PS2_DYNAMIC_VSYNC =
"SDL_PS2_DYNAMIC_VSYNC"
HINT_RETURN_KEY_HIDES_IME =
"SDL_RETURN_KEY_HIDES_IME"
HINT_RPI_VIDEO_LAYER =
"SDL_RPI_VIDEO_LAYER"
HINT_SCREENSAVER_INHIBIT_ACTIVITY_NAME =
"SDL_SCREENSAVER_INHIBIT_ACTIVITY_NAME"
HINT_THREAD_FORCE_REALTIME_TIME_CRITICAL =
"SDL_THREAD_FORCE_REALTIME_TIME_CRITICAL"
HINT_THREAD_PRIORITY_POLICY =
"SDL_THREAD_PRIORITY_POLICY"
HINT_THREAD_STACK_SIZE =
"SDL_THREAD_STACK_SIZE"
HINT_TIMER_RESOLUTION =
"SDL_TIMER_RESOLUTION"
HINT_TOUCH_MOUSE_EVENTS =
"SDL_TOUCH_MOUSE_EVENTS"
HINT_VITA_TOUCH_MOUSE_DEVICE =
"SDL_HINT_VITA_TOUCH_MOUSE_DEVICE"
HINT_TV_REMOTE_AS_JOYSTICK =
"SDL_TV_REMOTE_AS_JOYSTICK"
HINT_VIDEO_ALLOW_SCREENSAVER =
"SDL_VIDEO_ALLOW_SCREENSAVER"
HINT_VIDEO_DOUBLE_BUFFER =
"SDL_VIDEO_DOUBLE_BUFFER"
HINT_VIDEO_EGL_ALLOW_TRANSPARENCY =
"SDL_VIDEO_EGL_ALLOW_TRANSPARENCY"
HINT_VIDEO_EXTERNAL_CONTEXT =
"SDL_VIDEO_EXTERNAL_CONTEXT"
HINT_VIDEO_HIGHDPI_DISABLED =
"SDL_VIDEO_HIGHDPI_DISABLED"
HINT_VIDEO_MAC_FULLSCREEN_SPACES =
"SDL_VIDEO_MAC_FULLSCREEN_SPACES"
HINT_VIDEO_MINIMIZE_ON_FOCUS_LOSS =
"SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS"
HINT_VIDEO_WAYLAND_ALLOW_LIBDECOR =
"SDL_VIDEO_WAYLAND_ALLOW_LIBDECOR"
HINT_VIDEO_WAYLAND_PREFER_LIBDECOR =
"SDL_VIDEO_WAYLAND_PREFER_LIBDECOR"
HINT_VIDEO_WAYLAND_MODE_EMULATION =
"SDL_VIDEO_WAYLAND_MODE_EMULATION"
HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP =
"SDL_VIDEO_WAYLAND_EMULATE_MOUSE_WARP"
HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT =
"SDL_VIDEO_WINDOW_SHARE_PIXEL_FORMAT"
HINT_VIDEO_FOREIGN_WINDOW_OPENGL =
"SDL_VIDEO_FOREIGN_WINDOW_OPENGL"
HINT_VIDEO_FOREIGN_WINDOW_VULKAN =
"SDL_VIDEO_FOREIGN_WINDOW_VULKAN"
HINT_VIDEO_WIN_D3DCOMPILER =
"SDL_VIDEO_WIN_D3DCOMPILER"
HINT_VIDEO_X11_FORCE_EGL =
"SDL_VIDEO_X11_FORCE_EGL"
HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR =
"SDL_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR"
HINT_VIDEO_X11_NET_WM_PING =
"SDL_VIDEO_X11_NET_WM_PING"
HINT_VIDEO_X11_WINDOW_VISUALID =
"SDL_VIDEO_X11_WINDOW_VISUALID"
HINT_VIDEO_X11_XINERAMA =
"SDL_VIDEO_X11_XINERAMA"
HINT_VIDEO_X11_XRANDR =
"SDL_VIDEO_X11_XRANDR"
HINT_VIDEO_X11_XVIDMODE =
"SDL_VIDEO_X11_XVIDMODE"
HINT_WAVE_FACT_CHUNK =
"SDL_WAVE_FACT_CHUNK"
HINT_WAVE_RIFF_CHUNK_SIZE =
"SDL_WAVE_RIFF_CHUNK_SIZE"
HINT_WAVE_TRUNCATION =
"SDL_WAVE_TRUNCATION"
HINT_WINDOWS_DISABLE_THREAD_NAMING =
"SDL_WINDOWS_DISABLE_THREAD_NAMING"
HINT_WINDOWS_ENABLE_MENU_MNEMONICS =
"SDL_WINDOWS_ENABLE_MENU_MNEMONICS"
HINT_WINDOWS_ENABLE_MESSAGELOOP =
"SDL_WINDOWS_ENABLE_MESSAGELOOP"
HINT_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS =
"SDL_WINDOWS_FORCE_MUTEX_CRITICAL_SECTIONS"
HINT_WINDOWS_FORCE_SEMAPHORE_KERNEL =
"SDL_WINDOWS_FORCE_SEMAPHORE_KERNEL"
HINT_WINDOWS_INTRESOURCE_ICON =
"SDL_WINDOWS_INTRESOURCE_ICON"
HINT_WINDOWS_INTRESOURCE_ICON_SMALL =
"SDL_WINDOWS_INTRESOURCE_ICON_SMALL"
HINT_WINDOWS_NO_CLOSE_ON_ALT_F4 =
"SDL_WINDOWS_NO_CLOSE_ON_ALT_F4"
HINT_WINDOWS_USE_D3D9EX =
"SDL_WINDOWS_USE_D3D9EX"
HINT_WINDOWS_DPI_AWARENESS =
"SDL_WINDOWS_DPI_AWARENESS"
HINT_WINDOWS_DPI_SCALING =
"SDL_WINDOWS_DPI_SCALING"
HINT_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN =
"SDL_WINDOW_FRAME_USABLE_WHILE_CURSOR_HIDDEN"
HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN =
"SDL_WINDOW_NO_ACTIVATION_WHEN_SHOWN"
HINT_WINRT_HANDLE_BACK_BUTTON =
"SDL_WINRT_HANDLE_BACK_BUTTON"
HINT_WINRT_PRIVACY_POLICY_LABEL =
"SDL_WINRT_PRIVACY_POLICY_LABEL"
HINT_WINRT_PRIVACY_POLICY_URL =
"SDL_WINRT_PRIVACY_POLICY_URL"
HINT_X11_FORCE_OVERRIDE_REDIRECT =
"SDL_X11_FORCE_OVERRIDE_REDIRECT"
HINT_XINPUT_ENABLED =
"SDL_XINPUT_ENABLED"
HINT_DIRECTINPUT_ENABLED =
"SDL_DIRECTINPUT_ENABLED"
HINT_XINPUT_USE_OLD_JOYSTICK_MAPPING =
"SDL_XINPUT_USE_OLD_JOYSTICK_MAPPING"
HINT_AUDIO_INCLUDE_MONITORS =
"SDL_AUDIO_INCLUDE_MONITORS"
HINT_X11_WINDOW_TYPE =
"SDL_X11_WINDOW_TYPE"
HINT_QUIT_ON_LAST_WINDOW_CLOSE =
"SDL_QUIT_ON_LAST_WINDOW_CLOSE"
HINT_VIDEODRIVER =
"SDL_VIDEODRIVER"
HINT_AUDIODRIVER =
"SDL_AUDIODRIVER"
HINT_KMSDRM_DEVICE_INDEX =
"SDL_KMSDRM_DEVICE_INDEX"
HINT_TRACKPAD_IS_TOUCH_ONLY =
"SDL_TRACKPAD_IS_TOUCH_ONLY"
HINT_SHUTDOWN_DBUS_ON_QUIT =
"SDL_SHUTDOWN_DBUS_ON_QUIT"
HINT_DEFAULT =

Enum

0
HINT_NORMAL =
1
HINT_OVERRIDE =
2
IMAGE_MAJOR_VERSION =

Define/Macro

2
IMAGE_MINOR_VERSION =
8
IMAGE_PATCHLEVEL =
2
IMG_INIT_JPG =

Enum

1
IMG_INIT_PNG =
2
IMG_INIT_TIF =
4
IMG_INIT_WEBP =
8
IMG_INIT_JXL =
16
IMG_INIT_AVIF =
32
MIXER_MAJOR_VERSION =

Define/Macro

2
MIXER_MINOR_VERSION =
8
MIXER_PATCHLEVEL =
0
MIX_CHANNELS =
8
MIX_DEFAULT_FREQUENCY =
44100
MIX_DEFAULT_FORMAT =
AUDIO_S16SYS
MIX_DEFAULT_CHANNELS =
2
MIX_CHANNEL_POST =
-2
MIX_INIT_FLAC =

Enum

1
MIX_INIT_MOD =
2
MIX_INIT_MP3 =
8
MIX_INIT_OGG =
16
MIX_INIT_MID =
32
MIX_INIT_OPUS =
64
MIX_INIT_WAVPACK =
128
MIX_NO_FADING =
0
MIX_FADING_OUT =
1
MIX_FADING_IN =
2
MUS_NONE =
0
MUS_CMD =
1
MUS_WAV =
2
MUS_MOD =
3
MUS_MID =
4
MUS_OGG =
5
MUS_MP3 =
6
MUS_MP3_MAD_UNUSED =
7
MUS_FLAC =
8
MUS_MODPLUG_UNUSED =
9
MUS_OPUS =
10
MUS_WAVPACK =
11
MUS_GME =
12
BUTTON_LEFT =

Define/Macro

1
BUTTON_MIDDLE =
2
BUTTON_RIGHT =
3
BUTTON_X1 =
4
BUTTON_X2 =
5
SYSTEM_CURSOR_ARROW =

Enum

0
SYSTEM_CURSOR_IBEAM =
1
SYSTEM_CURSOR_WAIT =
2
SYSTEM_CURSOR_CROSSHAIR =
3
SYSTEM_CURSOR_WAITARROW =
4
SYSTEM_CURSOR_SIZENWSE =
5
SYSTEM_CURSOR_SIZENESW =
6
SYSTEM_CURSOR_SIZEWE =
7
SYSTEM_CURSOR_SIZENS =
8
SYSTEM_CURSOR_SIZEALL =
9
SYSTEM_CURSOR_NO =
10
SYSTEM_CURSOR_HAND =
11
NUM_SYSTEM_CURSORS =
12
MOUSEWHEEL_NORMAL =
0
MOUSEWHEEL_FLIPPED =
1
POWERSTATE_UNKNOWN =

Enum

0
POWERSTATE_ON_BATTERY =
1
POWERSTATE_NO_BATTERY =
2
POWERSTATE_CHARGING =
3
POWERSTATE_CHARGED =
4
RWOPS_UNKNOWN =

Define/Macro

0
RWOPS_WINFILE =
1
RWOPS_STDFILE =
2
RWOPS_JNIFILE =
3
RWOPS_MEMORY =
4
RWOPS_MEMORY_RO =
5
RW_SEEK_SET =
0
RW_SEEK_CUR =
1
RW_SEEK_END =
2
RWops =
Default_RWops
NONSHAPEABLE_WINDOW =

Define/Macro

-1
INVALID_SHAPE_ARGUMENT =
-2
WINDOW_LACKS_SHAPE =
-3
ShapeModeDefault =

Enum

0
ShapeModeBinarizeAlpha =
1
ShapeModeReverseBinarizeAlpha =
2
ShapeModeColorKey =
3
SOUND_VER_MAJOR =

Define/Macro

2
SOUND_VER_MINOR =
0
SOUND_VER_PATCH =
2
SOUND_SAMPLEFLAG_NONE =

Enum

0
SOUND_SAMPLEFLAG_CANSEEK =
1
SOUND_SAMPLEFLAG_EOF =
536870912
SOUND_SAMPLEFLAG_ERROR =
1073741824
SOUND_SAMPLEFLAG_EAGAIN =
-2147483648
METALVIEW_TAG =

Define/Macro

255
SYSWM_UNKNOWN =

Enum

0
SYSWM_WINDOWS =
1
SYSWM_X11 =
2
SYSWM_DIRECTFB =
3
SYSWM_COCOA =
4
SYSWM_UIKIT =
5
SYSWM_WAYLAND =
6
SYSWM_MIR =
7
SYSWM_WINRT =
8
SYSWM_ANDROID =
9
SYSWM_VIVANTE =
10
SYSWM_OS2 =
11
SYSWM_HAIKU =
12
SYSWM_KMSDRM =
13
SYSWM_RISCOS =
14
TOUCH_MOUSEID =

Define/Macro

4294967295
MOUSE_TOUCHID =
-1
TOUCH_DEVICE_INVALID =

Enum

-1
TOUCH_DEVICE_DIRECT =
0
TOUCH_DEVICE_INDIRECT_ABSOLUTE =
1
TOUCH_DEVICE_INDIRECT_RELATIVE =
2
WINDOWPOS_UNDEFINED_MASK =

Define/Macro

0x1FFF0000
WINDOWPOS_CENTERED_MASK =
0x2FFF0000
WINDOW_FULLSCREEN =

Enum

1
WINDOW_OPENGL =
2
WINDOW_SHOWN =
4
WINDOW_HIDDEN =
8
WINDOW_BORDERLESS =
16
WINDOW_RESIZABLE =
32
WINDOW_MINIMIZED =
64
WINDOW_MAXIMIZED =
128
WINDOW_MOUSE_GRABBED =
256
WINDOW_INPUT_FOCUS =
512
WINDOW_MOUSE_FOCUS =
1024
WINDOW_FULLSCREEN_DESKTOP =
4097
WINDOW_FOREIGN =
2048
WINDOW_ALLOW_HIGHDPI =
8192
WINDOW_MOUSE_CAPTURE =
16384
WINDOW_ALWAYS_ON_TOP =
32768
WINDOW_SKIP_TASKBAR =
65536
WINDOW_UTILITY =
131072
WINDOW_TOOLTIP =
262144
WINDOW_POPUP_MENU =
524288
WINDOW_KEYBOARD_GRABBED =
1048576
WINDOW_VULKAN =
268435456
WINDOW_METAL =
536870912
WINDOW_INPUT_GRABBED =
256
WINDOWEVENT_NONE =
0
WINDOWEVENT_SHOWN =
1
WINDOWEVENT_HIDDEN =
2
WINDOWEVENT_EXPOSED =
3
WINDOWEVENT_MOVED =
4
WINDOWEVENT_RESIZED =
5
WINDOWEVENT_SIZE_CHANGED =
6
WINDOWEVENT_MINIMIZED =
7
WINDOWEVENT_MAXIMIZED =
8
WINDOWEVENT_RESTORED =
9
WINDOWEVENT_ENTER =
10
WINDOWEVENT_LEAVE =
11
WINDOWEVENT_FOCUS_GAINED =
12
WINDOWEVENT_FOCUS_LOST =
13
WINDOWEVENT_CLOSE =
14
WINDOWEVENT_TAKE_FOCUS =
15
WINDOWEVENT_HIT_TEST =
16
WINDOWEVENT_ICCPROF_CHANGED =
17
WINDOWEVENT_DISPLAY_CHANGED =
18
DISPLAYEVENT_NONE =
0
DISPLAYEVENT_ORIENTATION =
1
DISPLAYEVENT_CONNECTED =
2
DISPLAYEVENT_DISCONNECTED =
3
DISPLAYEVENT_MOVED =
4
ORIENTATION_UNKNOWN =
0
ORIENTATION_LANDSCAPE =
1
ORIENTATION_LANDSCAPE_FLIPPED =
2
ORIENTATION_PORTRAIT =
3
ORIENTATION_PORTRAIT_FLIPPED =
4
FLASH_CANCEL =
0
FLASH_BRIEFLY =
1
FLASH_UNTIL_FOCUSED =
2
GL_RED_SIZE =
0
GL_GREEN_SIZE =
1
GL_BLUE_SIZE =
2
GL_ALPHA_SIZE =
3
GL_BUFFER_SIZE =
4
GL_DOUBLEBUFFER =
5
GL_DEPTH_SIZE =
6
GL_STENCIL_SIZE =
7
GL_ACCUM_RED_SIZE =
8
GL_ACCUM_GREEN_SIZE =
9
GL_ACCUM_BLUE_SIZE =
10
GL_ACCUM_ALPHA_SIZE =
11
GL_STEREO =
12
GL_MULTISAMPLEBUFFERS =
13
GL_MULTISAMPLESAMPLES =
14
GL_ACCELERATED_VISUAL =
15
GL_RETAINED_BACKING =
16
GL_CONTEXT_MAJOR_VERSION =
17
GL_CONTEXT_MINOR_VERSION =
18
GL_CONTEXT_EGL =
19
GL_CONTEXT_FLAGS =
20
GL_CONTEXT_PROFILE_MASK =
21
GL_SHARE_WITH_CURRENT_CONTEXT =
22
GL_FRAMEBUFFER_SRGB_CAPABLE =
23
GL_CONTEXT_RELEASE_BEHAVIOR =
24
GL_CONTEXT_RESET_NOTIFICATION =
25
GL_CONTEXT_NO_ERROR =
26
GL_FLOATBUFFERS =
27
GL_CONTEXT_PROFILE_CORE =
1
GL_CONTEXT_PROFILE_COMPATIBILITY =
2
GL_CONTEXT_PROFILE_ES =
4
GL_CONTEXT_DEBUG_FLAG =
1
GL_CONTEXT_FORWARD_COMPATIBLE_FLAG =
2
GL_CONTEXT_ROBUST_ACCESS_FLAG =
4
GL_CONTEXT_RESET_ISOLATION_FLAG =
8
GL_CONTEXT_RELEASE_BEHAVIOR_NONE =
0
GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH =
1
GL_CONTEXT_RESET_NO_NOTIFICATION =
0
GL_CONTEXT_RESET_LOSE_CONTEXT =
1
HITTEST_NORMAL =
0
HITTEST_DRAGGABLE =
1
HITTEST_RESIZE_TOPLEFT =
2
HITTEST_RESIZE_TOP =
3
HITTEST_RESIZE_TOPRIGHT =
4
HITTEST_RESIZE_RIGHT =
5
HITTEST_RESIZE_BOTTOMRIGHT =
6
HITTEST_RESIZE_BOTTOM =
7
HITTEST_RESIZE_BOTTOMLEFT =
8
HITTEST_RESIZE_LEFT =
9
RELEASED =

Define/Macro

0
PRESSED =
1
TEXTEDITINGEVENT_TEXT_SIZE =
32
TEXTINPUTEVENT_TEXT_SIZE =
32
QUERY =
-1
IGNORE =
0
DISABLE =
0
ENABLE =
1
FIRSTEVENT =

Enum

0
QUIT =
256
APP_TERMINATING =
257
APP_LOWMEMORY =
258
APP_WILLENTERBACKGROUND =
259
APP_DIDENTERBACKGROUND =
260
APP_WILLENTERFOREGROUND =
261
APP_DIDENTERFOREGROUND =
262
LOCALECHANGED =
263
DISPLAYEVENT =
336
WINDOWEVENT =
512
SYSWMEVENT =
513
KEYDOWN =
768
KEYUP =
769
TEXTEDITING =
770
TEXTINPUT =
771
KEYMAPCHANGED =
772
TEXTEDITING_EXT =
773
MOUSEMOTION =
1024
MOUSEBUTTONDOWN =
1025
MOUSEBUTTONUP =
1026
MOUSEWHEEL =
1027
JOYAXISMOTION =
1536
JOYBALLMOTION =
1537
JOYHATMOTION =
1538
JOYBUTTONDOWN =
1539
JOYBUTTONUP =
1540
JOYDEVICEADDED =
1541
JOYDEVICEREMOVED =
1542
JOYBATTERYUPDATED =
1543
CONTROLLERAXISMOTION =
1616
CONTROLLERBUTTONDOWN =
1617
CONTROLLERBUTTONUP =
1618
CONTROLLERDEVICEADDED =
1619
CONTROLLERDEVICEREMOVED =
1620
CONTROLLERDEVICEREMAPPED =
1621
CONTROLLERTOUCHPADDOWN =
1622
CONTROLLERTOUCHPADMOTION =
1623
CONTROLLERTOUCHPADUP =
1624
CONTROLLERSENSORUPDATE =
1625
CONTROLLERUPDATECOMPLETE_RESERVED_FOR_SDL3 =
1626
CONTROLLERSTEAMHANDLEUPDATED =
1627
FINGERDOWN =
1792
FINGERUP =
1793
FINGERMOTION =
1794
DOLLARGESTURE =
2048
DOLLARRECORD =
2049
MULTIGESTURE =
2050
CLIPBOARDUPDATE =
2304
DROPFILE =
4096
DROPTEXT =
4097
DROPBEGIN =
4098
DROPCOMPLETE =
4099
AUDIODEVICEADDED =
4352
AUDIODEVICEREMOVED =
4353
SENSORUPDATE =
4608
RENDER_TARGETS_RESET =
8192
RENDER_DEVICE_RESET =
8193
POLLSENTINEL =
32512
USEREVENT =
32768
LASTEVENT =
65535
ADDEVENT =
0
PEEKEVENT =
1
GETEVENT =
2
HAPTIC_CONSTANT =

Define/Macro

1 << 0
HAPTIC_SINE =
1 << 1
HAPTIC_LEFTRIGHT =
1 << 2
HAPTIC_TRIANGLE =
1 << 3
HAPTIC_SAWTOOTHUP =
1 << 4
HAPTIC_SAWTOOTHDOWN =
1 << 5
HAPTIC_RAMP =
1 << 6
HAPTIC_SPRING =
1 << 7
HAPTIC_DAMPER =
1 << 8
HAPTIC_INERTIA =
1 << 9
HAPTIC_FRICTION =
1 << 10
HAPTIC_CUSTOM =
1 << 11
HAPTIC_GAIN =
1 << 12
HAPTIC_AUTOCENTER =
1 << 13
HAPTIC_STATUS =
1 << 14
HAPTIC_PAUSE =
1 << 15
HAPTIC_POLAR =
0
HAPTIC_CARTESIAN =
1
HAPTIC_SPHERICAL =
2
HAPTIC_STEERING_AXIS =
3
HAPTIC_INFINITY =
4294967295
ALPHA_OPAQUE =

Define/Macro

255
ALPHA_TRANSPARENT =
0
PIXELTYPE_UNKNOWN =

Enum

0
PIXELTYPE_INDEX1 =
1
PIXELTYPE_INDEX4 =
2
PIXELTYPE_INDEX8 =
3
PIXELTYPE_PACKED8 =
4
PIXELTYPE_PACKED16 =
5
PIXELTYPE_PACKED32 =
6
PIXELTYPE_ARRAYU8 =
7
PIXELTYPE_ARRAYU16 =
8
PIXELTYPE_ARRAYU32 =
9
PIXELTYPE_ARRAYF16 =
10
PIXELTYPE_ARRAYF32 =
11
PIXELTYPE_INDEX2 =
12
BITMAPORDER_NONE =
0
BITMAPORDER_4321 =
1
BITMAPORDER_1234 =
2
PACKEDORDER_NONE =
0
PACKEDORDER_XRGB =
1
PACKEDORDER_RGBX =
2
PACKEDORDER_ARGB =
3
PACKEDORDER_RGBA =
4
PACKEDORDER_XBGR =
5
PACKEDORDER_BGRX =
6
PACKEDORDER_ABGR =
7
PACKEDORDER_BGRA =
8
ARRAYORDER_NONE =
0
ARRAYORDER_RGB =
1
ARRAYORDER_RGBA =
2
ARRAYORDER_ARGB =
3
ARRAYORDER_BGR =
4
ARRAYORDER_BGRA =
5
ARRAYORDER_ABGR =
6
PACKEDLAYOUT_NONE =
0
PACKEDLAYOUT_332 =
1
PACKEDLAYOUT_4444 =
2
PACKEDLAYOUT_1555 =
3
PACKEDLAYOUT_5551 =
4
PACKEDLAYOUT_565 =
5
PACKEDLAYOUT_8888 =
6
PACKEDLAYOUT_2101010 =
7
PACKEDLAYOUT_1010102 =
8
PIXELFORMAT_UNKNOWN =
0
PIXELFORMAT_INDEX1LSB =
286261504
PIXELFORMAT_INDEX1MSB =
287310080
PIXELFORMAT_INDEX2LSB =
470811136
PIXELFORMAT_INDEX2MSB =
471859712
PIXELFORMAT_INDEX4LSB =
303039488
PIXELFORMAT_INDEX4MSB =
304088064
PIXELFORMAT_INDEX8 =
318769153
PIXELFORMAT_RGB332 =
336660481
PIXELFORMAT_XRGB4444 =
353504258
PIXELFORMAT_RGB444 =
353504258
PIXELFORMAT_XBGR4444 =
357698562
PIXELFORMAT_BGR444 =
357698562
PIXELFORMAT_XRGB1555 =
353570562
PIXELFORMAT_RGB555 =
353570562
PIXELFORMAT_XBGR1555 =
357764866
PIXELFORMAT_BGR555 =
357764866
PIXELFORMAT_ARGB4444 =
355602434
PIXELFORMAT_RGBA4444 =
356651010
PIXELFORMAT_ABGR4444 =
359796738
PIXELFORMAT_BGRA4444 =
360845314
PIXELFORMAT_ARGB1555 =
355667970
PIXELFORMAT_RGBA5551 =
356782082
PIXELFORMAT_ABGR1555 =
359862274
PIXELFORMAT_BGRA5551 =
360976386
PIXELFORMAT_RGB565 =
353701890
PIXELFORMAT_BGR565 =
357896194
PIXELFORMAT_RGB24 =
386930691
PIXELFORMAT_BGR24 =
390076419
PIXELFORMAT_XRGB8888 =
370546692
PIXELFORMAT_RGB888 =
370546692
PIXELFORMAT_RGBX8888 =
371595268
PIXELFORMAT_XBGR8888 =
374740996
PIXELFORMAT_BGR888 =
374740996
PIXELFORMAT_BGRX8888 =
375789572
PIXELFORMAT_ARGB8888 =
372645892
PIXELFORMAT_RGBA8888 =
373694468
PIXELFORMAT_ABGR8888 =
376840196
PIXELFORMAT_BGRA8888 =
377888772
PIXELFORMAT_ARGB2101010 =
372711428
PIXELFORMAT_RGBA32 =
376840196
PIXELFORMAT_ARGB32 =
377888772
PIXELFORMAT_BGRA32 =
372645892
PIXELFORMAT_ABGR32 =
373694468
PIXELFORMAT_RGBX32 =
374740996
PIXELFORMAT_XRGB32 =
375789572
PIXELFORMAT_BGRX32 =
370546692
PIXELFORMAT_XBGR32 =
371595268
PIXELFORMAT_YV12 =
842094169
PIXELFORMAT_IYUV =
1448433993
PIXELFORMAT_YUY2 =
844715353
PIXELFORMAT_UYVY =
1498831189
PIXELFORMAT_YVYU =
1431918169
PIXELFORMAT_NV12 =
842094158
PIXELFORMAT_NV21 =
825382478
PIXELFORMAT_EXTERNAL_OES =
542328143
RENDERER_SOFTWARE =

Enum

1
RENDERER_ACCELERATED =
2
RENDERER_PRESENTVSYNC =
4
RENDERER_TARGETTEXTURE =
8
ScaleModeNearest =
0
ScaleModeLinear =
1
ScaleModeBest =
2
TEXTUREACCESS_STATIC =
0
TEXTUREACCESS_STREAMING =
1
TEXTUREACCESS_TARGET =
2
TEXTUREMODULATE_NONE =
0
TEXTUREMODULATE_COLOR =
1
TEXTUREMODULATE_ALPHA =
2
FLIP_NONE =
0
FLIP_HORIZONTAL =
1
FLIP_VERTICAL =
2
STANDARD_GRAVITY =

Define/Macro

9.80665
SENSOR_INVALID =

Enum

-1
SENSOR_UNKNOWN =
0
SENSOR_ACCEL =
1
SENSOR_GYRO =
2
SENSOR_ACCEL_L =
3
SENSOR_GYRO_L =
4
SENSOR_ACCEL_R =
5
SENSOR_GYRO_R =
6
ICONV_ERROR =

Define/Macro

4294967295
ICONV_E2BIG =
4294967294
ICONV_EILSEQ =
4294967293
ICONV_EINVAL =
4294967292
FALSE =

Enum

0
TRUE =
1
CACHELINE_SIZE =

Define/Macro

128
SDLK_UNKNOWN =

Enum

0
SDLK_RETURN =
13
SDLK_ESCAPE =
27
SDLK_BACKSPACE =
8
SDLK_TAB =
9
SDLK_SPACE =
32
SDLK_EXCLAIM =
33
SDLK_QUOTEDBL =
34
SDLK_HASH =
35
SDLK_PERCENT =
37
SDLK_DOLLAR =
36
SDLK_AMPERSAND =
38
SDLK_QUOTE =
39
SDLK_LEFTPAREN =
40
SDLK_RIGHTPAREN =
41
SDLK_ASTERISK =
42
SDLK_PLUS =
43
SDLK_COMMA =
44
SDLK_MINUS =
45
SDLK_PERIOD =
46
SDLK_SLASH =
47
SDLK_0 =
48
SDLK_1 =
49
SDLK_2 =
50
SDLK_3 =
51
SDLK_4 =
52
SDLK_5 =
53
SDLK_6 =
54
SDLK_7 =
55
SDLK_8 =
56
SDLK_9 =
57
SDLK_COLON =
58
SDLK_SEMICOLON =
59
SDLK_LESS =
60
SDLK_EQUALS =
61
SDLK_GREATER =
62
SDLK_QUESTION =
63
SDLK_AT =
64
SDLK_LEFTBRACKET =
91
SDLK_BACKSLASH =
92
SDLK_RIGHTBRACKET =
93
SDLK_CARET =
94
SDLK_UNDERSCORE =
95
SDLK_BACKQUOTE =
96
SDLK_a =
97
SDLK_b =
98
SDLK_c =
99
SDLK_d =
100
SDLK_e =
101
SDLK_f =
102
SDLK_g =
103
SDLK_h =
104
SDLK_i =
105
SDLK_j =
106
SDLK_k =
107
SDLK_l =
108
SDLK_m =
109
SDLK_n =
110
SDLK_o =
111
SDLK_p =
112
SDLK_q =
113
SDLK_r =
114
SDLK_s =
115
SDLK_t =
116
SDLK_u =
117
SDLK_v =
118
SDLK_w =
119
SDLK_x =
120
SDLK_y =
121
SDLK_z =
122
SDLK_CAPSLOCK =
1073741881
SDLK_F1 =
1073741882
SDLK_F2 =
1073741883
SDLK_F3 =
1073741884
SDLK_F4 =
1073741885
SDLK_F5 =
1073741886
SDLK_F6 =
1073741887
SDLK_F7 =
1073741888
SDLK_F8 =
1073741889
SDLK_F9 =
1073741890
SDLK_F10 =
1073741891
SDLK_F11 =
1073741892
SDLK_F12 =
1073741893
SDLK_PRINTSCREEN =
1073741894
SDLK_SCROLLLOCK =
1073741895
SDLK_PAUSE =
1073741896
SDLK_INSERT =
1073741897
SDLK_HOME =
1073741898
SDLK_PAGEUP =
1073741899
SDLK_DELETE =
127
SDLK_END =
1073741901
SDLK_PAGEDOWN =
1073741902
SDLK_RIGHT =
1073741903
SDLK_LEFT =
1073741904
SDLK_DOWN =
1073741905
SDLK_UP =
1073741906
SDLK_NUMLOCKCLEAR =
1073741907
SDLK_KP_DIVIDE =
1073741908
SDLK_KP_MULTIPLY =
1073741909
SDLK_KP_MINUS =
1073741910
SDLK_KP_PLUS =
1073741911
SDLK_KP_ENTER =
1073741912
SDLK_KP_1 =
1073741913
SDLK_KP_2 =
1073741914
SDLK_KP_3 =
1073741915
SDLK_KP_4 =
1073741916
SDLK_KP_5 =
1073741917
SDLK_KP_6 =
1073741918
SDLK_KP_7 =
1073741919
SDLK_KP_8 =
1073741920
SDLK_KP_9 =
1073741921
SDLK_KP_0 =
1073741922
SDLK_KP_PERIOD =
1073741923
SDLK_APPLICATION =
1073741925
SDLK_POWER =
1073741926
SDLK_KP_EQUALS =
1073741927
SDLK_F13 =
1073741928
SDLK_F14 =
1073741929
SDLK_F15 =
1073741930
SDLK_F16 =
1073741931
SDLK_F17 =
1073741932
SDLK_F18 =
1073741933
SDLK_F19 =
1073741934
SDLK_F20 =
1073741935
SDLK_F21 =
1073741936
SDLK_F22 =
1073741937
SDLK_F23 =
1073741938
SDLK_F24 =
1073741939
SDLK_EXECUTE =
1073741940
SDLK_HELP =
1073741941
SDLK_MENU =
1073741942
SDLK_SELECT =
1073741943
SDLK_STOP =
1073741944
SDLK_AGAIN =
1073741945
SDLK_UNDO =
1073741946
SDLK_CUT =
1073741947
SDLK_COPY =
1073741948
SDLK_PASTE =
1073741949
SDLK_FIND =
1073741950
SDLK_MUTE =
1073741951
SDLK_VOLUMEUP =
1073741952
SDLK_VOLUMEDOWN =
1073741953
SDLK_KP_COMMA =
1073741957
SDLK_KP_EQUALSAS400 =
1073741958
SDLK_ALTERASE =
1073741977
SDLK_SYSREQ =
1073741978
SDLK_CANCEL =
1073741979
SDLK_CLEAR =
1073741980
SDLK_PRIOR =
1073741981
SDLK_RETURN2 =
1073741982
SDLK_SEPARATOR =
1073741983
SDLK_OUT =
1073741984
SDLK_OPER =
1073741985
SDLK_CLEARAGAIN =
1073741986
SDLK_CRSEL =
1073741987
SDLK_EXSEL =
1073741988
SDLK_KP_00 =
1073742000
SDLK_KP_000 =
1073742001
SDLK_THOUSANDSSEPARATOR =
1073742002
SDLK_DECIMALSEPARATOR =
1073742003
SDLK_CURRENCYUNIT =
1073742004
SDLK_CURRENCYSUBUNIT =
1073742005
SDLK_KP_LEFTPAREN =
1073742006
SDLK_KP_RIGHTPAREN =
1073742007
SDLK_KP_LEFTBRACE =
1073742008
SDLK_KP_RIGHTBRACE =
1073742009
SDLK_KP_TAB =
1073742010
SDLK_KP_BACKSPACE =
1073742011
SDLK_KP_A =
1073742012
SDLK_KP_B =
1073742013
SDLK_KP_C =
1073742014
SDLK_KP_D =
1073742015
SDLK_KP_E =
1073742016
SDLK_KP_F =
1073742017
SDLK_KP_XOR =
1073742018
SDLK_KP_POWER =
1073742019
SDLK_KP_PERCENT =
1073742020
SDLK_KP_LESS =
1073742021
SDLK_KP_GREATER =
1073742022
SDLK_KP_AMPERSAND =
1073742023
SDLK_KP_DBLAMPERSAND =
1073742024
SDLK_KP_VERTICALBAR =
1073742025
SDLK_KP_DBLVERTICALBAR =
1073742026
SDLK_KP_COLON =
1073742027
SDLK_KP_HASH =
1073742028
SDLK_KP_SPACE =
1073742029
SDLK_KP_AT =
1073742030
SDLK_KP_EXCLAM =
1073742031
SDLK_KP_MEMSTORE =
1073742032
SDLK_KP_MEMRECALL =
1073742033
SDLK_KP_MEMCLEAR =
1073742034
SDLK_KP_MEMADD =
1073742035
SDLK_KP_MEMSUBTRACT =
1073742036
SDLK_KP_MEMMULTIPLY =
1073742037
SDLK_KP_MEMDIVIDE =
1073742038
SDLK_KP_PLUSMINUS =
1073742039
SDLK_KP_CLEAR =
1073742040
SDLK_KP_CLEARENTRY =
1073742041
SDLK_KP_BINARY =
1073742042
SDLK_KP_OCTAL =
1073742043
SDLK_KP_DECIMAL =
1073742044
SDLK_KP_HEXADECIMAL =
1073742045
SDLK_LCTRL =
1073742048
SDLK_LSHIFT =
1073742049
SDLK_LALT =
1073742050
SDLK_LGUI =
1073742051
SDLK_RCTRL =
1073742052
SDLK_RSHIFT =
1073742053
SDLK_RALT =
1073742054
SDLK_RGUI =
1073742055
SDLK_MODE =
1073742081
SDLK_AUDIONEXT =
1073742082
SDLK_AUDIOPREV =
1073742083
SDLK_AUDIOSTOP =
1073742084
SDLK_AUDIOPLAY =
1073742085
SDLK_AUDIOMUTE =
1073742086
SDLK_MEDIASELECT =
1073742087
SDLK_WWW =
1073742088
SDLK_MAIL =
1073742089
SDLK_CALCULATOR =
1073742090
SDLK_COMPUTER =
1073742091
SDLK_AC_SEARCH =
1073742092
SDLK_AC_HOME =
1073742093
SDLK_AC_BACK =
1073742094
SDLK_AC_FORWARD =
1073742095
SDLK_AC_STOP =
1073742096
SDLK_AC_REFRESH =
1073742097
SDLK_AC_BOOKMARKS =
1073742098
SDLK_BRIGHTNESSDOWN =
1073742099
SDLK_BRIGHTNESSUP =
1073742100
SDLK_DISPLAYSWITCH =
1073742101
SDLK_KBDILLUMTOGGLE =
1073742102
SDLK_KBDILLUMDOWN =
1073742103
SDLK_KBDILLUMUP =
1073742104
SDLK_EJECT =
1073742105
SDLK_SLEEP =
1073742106
SDLK_APP1 =
1073742107
SDLK_APP2 =
1073742108
SDLK_AUDIOREWIND =
1073742109
SDLK_AUDIOFASTFORWARD =
1073742110
SDLK_SOFTLEFT =
1073742111
SDLK_SOFTRIGHT =
1073742112
SDLK_CALL =
1073742113
SDLK_ENDCALL =
1073742114
KMOD_NONE =
0
KMOD_LSHIFT =
1
KMOD_RSHIFT =
2
KMOD_LCTRL =
64
KMOD_RCTRL =
128
KMOD_LALT =
256
KMOD_RALT =
512
KMOD_LGUI =
1024
KMOD_RGUI =
2048
KMOD_NUM =
4096
KMOD_CAPS =
8192
KMOD_MODE =
16384
KMOD_SCROLL =
32768
KMOD_CTRL =
192
KMOD_SHIFT =
3
KMOD_ALT =
768
KMOD_GUI =
3072
KMOD_RESERVED =
32768
SWSURFACE =

Define/Macro

0
PREALLOC =
0x00000001
RLEACCEL =
0x00000002
DONTFREE =
0x00000004
SIMD_ALIGNED =
0x00000008
YUV_CONVERSION_JPEG =

Enum

0
YUV_CONVERSION_BT601 =
1
YUV_CONVERSION_BT709 =
2
YUV_CONVERSION_AUTOMATIC =
3
MAJOR_VERSION =

Define/Macro

2
MINOR_VERSION =
30
PATCHLEVEL =
0
IPHONE_MAX_GFORCE =

Define/Macro

5.0
VIRTUAL_JOYSTICK_DESC_VERSION =
1
JOYSTICK_AXIS_MAX =
32767
JOYSTICK_AXIS_MIN =
-32768
HAT_CENTERED =
0x00
HAT_UP =
0x01
HAT_RIGHT =
0x02
HAT_DOWN =
0x04
HAT_LEFT =
0x08
HAT_RIGHTUP =
(HAT_RIGHT | HAT_UP)
HAT_RIGHTDOWN =
(HAT_RIGHT | HAT_DOWN)
HAT_LEFTUP =
(HAT_LEFT | HAT_UP)
HAT_LEFTDOWN =
(HAT_LEFT | HAT_DOWN)
JOYSTICK_TYPE_UNKNOWN =

Enum

0
JOYSTICK_TYPE_GAMECONTROLLER =
1
JOYSTICK_TYPE_WHEEL =
2
JOYSTICK_TYPE_ARCADE_STICK =
3
JOYSTICK_TYPE_FLIGHT_STICK =
4
JOYSTICK_TYPE_DANCE_PAD =
5
JOYSTICK_TYPE_GUITAR =
6
JOYSTICK_TYPE_DRUM_KIT =
7
JOYSTICK_TYPE_ARCADE_PAD =
8
JOYSTICK_TYPE_THROTTLE =
9
JOYSTICK_POWER_UNKNOWN =
-1
JOYSTICK_POWER_EMPTY =
0
JOYSTICK_POWER_LOW =
1
JOYSTICK_POWER_MEDIUM =
2
JOYSTICK_POWER_FULL =
3
JOYSTICK_POWER_WIRED =
4
JOYSTICK_POWER_MAX =
5
JoystickGUID =
SDL::GUID
SCANCODE_UNKNOWN =

Enum

0
SCANCODE_A =
4
SCANCODE_B =
5
SCANCODE_C =
6
SCANCODE_D =
7
SCANCODE_E =
8
SCANCODE_F =
9
SCANCODE_G =
10
SCANCODE_H =
11
SCANCODE_I =
12
SCANCODE_J =
13
SCANCODE_K =
14
SCANCODE_L =
15
SCANCODE_M =
16
SCANCODE_N =
17
SCANCODE_O =
18
SCANCODE_P =
19
SCANCODE_Q =
20
SCANCODE_R =
21
SCANCODE_S =
22
SCANCODE_T =
23
SCANCODE_U =
24
SCANCODE_V =
25
SCANCODE_W =
26
SCANCODE_X =
27
SCANCODE_Y =
28
SCANCODE_Z =
29
SCANCODE_1 =
30
SCANCODE_2 =
31
SCANCODE_3 =
32
SCANCODE_4 =
33
SCANCODE_5 =
34
SCANCODE_6 =
35
SCANCODE_7 =
36
SCANCODE_8 =
37
SCANCODE_9 =
38
SCANCODE_0 =
39
SCANCODE_RETURN =
40
SCANCODE_ESCAPE =
41
SCANCODE_BACKSPACE =
42
SCANCODE_TAB =
43
SCANCODE_SPACE =
44
SCANCODE_MINUS =
45
SCANCODE_EQUALS =
46
SCANCODE_LEFTBRACKET =
47
SCANCODE_RIGHTBRACKET =
48
SCANCODE_BACKSLASH =
49
SCANCODE_NONUSHASH =
50
SCANCODE_SEMICOLON =
51
SCANCODE_APOSTROPHE =
52
SCANCODE_GRAVE =
53
SCANCODE_COMMA =
54
SCANCODE_PERIOD =
55
SCANCODE_SLASH =
56
SCANCODE_CAPSLOCK =
57
SCANCODE_F1 =
58
SCANCODE_F2 =
59
SCANCODE_F3 =
60
SCANCODE_F4 =
61
SCANCODE_F5 =
62
SCANCODE_F6 =
63
SCANCODE_F7 =
64
SCANCODE_F8 =
65
SCANCODE_F9 =
66
SCANCODE_F10 =
67
SCANCODE_F11 =
68
SCANCODE_F12 =
69
SCANCODE_PRINTSCREEN =
70
SCANCODE_SCROLLLOCK =
71
SCANCODE_PAUSE =
72
SCANCODE_INSERT =
73
SCANCODE_HOME =
74
SCANCODE_PAGEUP =
75
SCANCODE_DELETE =
76
SCANCODE_END =
77
SCANCODE_PAGEDOWN =
78
SCANCODE_RIGHT =
79
SCANCODE_LEFT =
80
SCANCODE_DOWN =
81
SCANCODE_UP =
82
SCANCODE_NUMLOCKCLEAR =
83
SCANCODE_KP_DIVIDE =
84
SCANCODE_KP_MULTIPLY =
85
SCANCODE_KP_MINUS =
86
SCANCODE_KP_PLUS =
87
SCANCODE_KP_ENTER =
88
SCANCODE_KP_1 =
89
SCANCODE_KP_2 =
90
SCANCODE_KP_3 =
91
SCANCODE_KP_4 =
92
SCANCODE_KP_5 =
93
SCANCODE_KP_6 =
94
SCANCODE_KP_7 =
95
SCANCODE_KP_8 =
96
SCANCODE_KP_9 =
97
SCANCODE_KP_0 =
98
SCANCODE_KP_PERIOD =
99
SCANCODE_NONUSBACKSLASH =
100
SCANCODE_APPLICATION =
101
SCANCODE_POWER =
102
SCANCODE_KP_EQUALS =
103
SCANCODE_F13 =
104
SCANCODE_F14 =
105
SCANCODE_F15 =
106
SCANCODE_F16 =
107
SCANCODE_F17 =
108
SCANCODE_F18 =
109
SCANCODE_F19 =
110
SCANCODE_F20 =
111
SCANCODE_F21 =
112
SCANCODE_F22 =
113
SCANCODE_F23 =
114
SCANCODE_F24 =
115
SCANCODE_EXECUTE =
116
SCANCODE_HELP =
117
SCANCODE_MENU =
118
SCANCODE_SELECT =
119
SCANCODE_STOP =
120
SCANCODE_AGAIN =
121
SCANCODE_UNDO =
122
SCANCODE_CUT =
123
SCANCODE_COPY =
124
SCANCODE_PASTE =
125
SCANCODE_FIND =
126
SCANCODE_MUTE =
127
SCANCODE_VOLUMEUP =
128
SCANCODE_VOLUMEDOWN =
129
SCANCODE_KP_COMMA =
133
SCANCODE_KP_EQUALSAS400 =
134
SCANCODE_INTERNATIONAL1 =
135
SCANCODE_INTERNATIONAL2 =
136
SCANCODE_INTERNATIONAL3 =
137
SCANCODE_INTERNATIONAL4 =
138
SCANCODE_INTERNATIONAL5 =
139
SCANCODE_INTERNATIONAL6 =
140
SCANCODE_INTERNATIONAL7 =
141
SCANCODE_INTERNATIONAL8 =
142
SCANCODE_INTERNATIONAL9 =
143
SCANCODE_LANG1 =
144
SCANCODE_LANG2 =
145
SCANCODE_LANG3 =
146
SCANCODE_LANG4 =
147
SCANCODE_LANG5 =
148
SCANCODE_LANG6 =
149
SCANCODE_LANG7 =
150
SCANCODE_LANG8 =
151
SCANCODE_LANG9 =
152
SCANCODE_ALTERASE =
153
SCANCODE_SYSREQ =
154
SCANCODE_CANCEL =
155
SCANCODE_CLEAR =
156
SCANCODE_PRIOR =
157
SCANCODE_RETURN2 =
158
SCANCODE_SEPARATOR =
159
SCANCODE_OUT =
160
SCANCODE_OPER =
161
SCANCODE_CLEARAGAIN =
162
SCANCODE_CRSEL =
163
SCANCODE_EXSEL =
164
SCANCODE_KP_00 =
176
SCANCODE_KP_000 =
177
SCANCODE_THOUSANDSSEPARATOR =
178
SCANCODE_DECIMALSEPARATOR =
179
SCANCODE_CURRENCYUNIT =
180
SCANCODE_CURRENCYSUBUNIT =
181
SCANCODE_KP_LEFTPAREN =
182
SCANCODE_KP_RIGHTPAREN =
183
SCANCODE_KP_LEFTBRACE =
184
SCANCODE_KP_RIGHTBRACE =
185
SCANCODE_KP_TAB =
186
SCANCODE_KP_BACKSPACE =
187
SCANCODE_KP_A =
188
SCANCODE_KP_B =
189
SCANCODE_KP_C =
190
SCANCODE_KP_D =
191
SCANCODE_KP_E =
192
SCANCODE_KP_F =
193
SCANCODE_KP_XOR =
194
SCANCODE_KP_POWER =
195
SCANCODE_KP_PERCENT =
196
SCANCODE_KP_LESS =
197
SCANCODE_KP_GREATER =
198
SCANCODE_KP_AMPERSAND =
199
SCANCODE_KP_DBLAMPERSAND =
200
SCANCODE_KP_VERTICALBAR =
201
SCANCODE_KP_DBLVERTICALBAR =
202
SCANCODE_KP_COLON =
203
SCANCODE_KP_HASH =
204
SCANCODE_KP_SPACE =
205
SCANCODE_KP_AT =
206
SCANCODE_KP_EXCLAM =
207
SCANCODE_KP_MEMSTORE =
208
SCANCODE_KP_MEMRECALL =
209
SCANCODE_KP_MEMCLEAR =
210
SCANCODE_KP_MEMADD =
211
SCANCODE_KP_MEMSUBTRACT =
212
SCANCODE_KP_MEMMULTIPLY =
213
SCANCODE_KP_MEMDIVIDE =
214
SCANCODE_KP_PLUSMINUS =
215
SCANCODE_KP_CLEAR =
216
SCANCODE_KP_CLEARENTRY =
217
SCANCODE_KP_BINARY =
218
SCANCODE_KP_OCTAL =
219
SCANCODE_KP_DECIMAL =
220
SCANCODE_KP_HEXADECIMAL =
221
SCANCODE_LCTRL =
224
SCANCODE_LSHIFT =
225
SCANCODE_LALT =
226
SCANCODE_LGUI =
227
SCANCODE_RCTRL =
228
SCANCODE_RSHIFT =
229
SCANCODE_RALT =
230
SCANCODE_RGUI =
231
SCANCODE_MODE =
257
SCANCODE_AUDIONEXT =
258
SCANCODE_AUDIOPREV =
259
SCANCODE_AUDIOSTOP =
260
SCANCODE_AUDIOPLAY =
261
SCANCODE_AUDIOMUTE =
262
SCANCODE_MEDIASELECT =
263
SCANCODE_WWW =
264
SCANCODE_MAIL =
265
SCANCODE_CALCULATOR =
266
SCANCODE_COMPUTER =
267
SCANCODE_AC_SEARCH =
268
SCANCODE_AC_HOME =
269
SCANCODE_AC_BACK =
270
SCANCODE_AC_FORWARD =
271
SCANCODE_AC_STOP =
272
SCANCODE_AC_REFRESH =
273
SCANCODE_AC_BOOKMARKS =
274
SCANCODE_BRIGHTNESSDOWN =
275
SCANCODE_BRIGHTNESSUP =
276
SCANCODE_DISPLAYSWITCH =
277
SCANCODE_KBDILLUMTOGGLE =
278
SCANCODE_KBDILLUMDOWN =
279
SCANCODE_KBDILLUMUP =
280
SCANCODE_EJECT =
281
SCANCODE_SLEEP =
282
SCANCODE_APP1 =
283
SCANCODE_APP2 =
284
SCANCODE_AUDIOREWIND =
285
SCANCODE_AUDIOFASTFORWARD =
286
SCANCODE_SOFTLEFT =
287
SCANCODE_SOFTRIGHT =
288
SCANCODE_CALL =
289
SCANCODE_ENDCALL =
290
NUM_SCANCODES =
512
BLENDMODE_NONE =

Enum

0
BLENDMODE_BLEND =
1
BLENDMODE_ADD =
2
BLENDMODE_MOD =
4
BLENDMODE_MUL =
8
BLENDMODE_INVALID =
2147483647
BLENDOPERATION_ADD =
1
BLENDOPERATION_SUBTRACT =
2
BLENDOPERATION_REV_SUBTRACT =
3
BLENDOPERATION_MINIMUM =
4
BLENDOPERATION_MAXIMUM =
5
BLENDFACTOR_ZERO =
1
BLENDFACTOR_ONE =
2
BLENDFACTOR_SRC_COLOR =
3
BLENDFACTOR_ONE_MINUS_SRC_COLOR =
4
BLENDFACTOR_SRC_ALPHA =
5
BLENDFACTOR_ONE_MINUS_SRC_ALPHA =
6
BLENDFACTOR_DST_COLOR =
7
BLENDFACTOR_ONE_MINUS_DST_COLOR =
8
BLENDFACTOR_DST_ALPHA =
9
BLENDFACTOR_ONE_MINUS_DST_ALPHA =
10
MESSAGEBOX_ERROR =

Enum

16
MESSAGEBOX_WARNING =
32
MESSAGEBOX_INFORMATION =
64
MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT =
128
MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT =
256
MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT =
1
MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT =
2
MESSAGEBOX_COLOR_BACKGROUND =
0
MESSAGEBOX_COLOR_TEXT =
1
MESSAGEBOX_COLOR_BUTTON_BORDER =
2
MESSAGEBOX_COLOR_BUTTON_BACKGROUND =
3
MESSAGEBOX_COLOR_BUTTON_SELECTED =
4
MESSAGEBOX_COLOR_MAX =
5
SDL2_GFXPRIMITIVES_MAJOR =

Define/Macro

1
SDL2_GFXPRIMITIVES_MINOR =
0
SDL2_GFXPRIMITIVES_MICRO =
4
CONTROLLER_TYPE_UNKNOWN =

Enum

0
CONTROLLER_TYPE_XBOX360 =
1
CONTROLLER_TYPE_XBOXONE =
2
CONTROLLER_TYPE_PS3 =
3
CONTROLLER_TYPE_PS4 =
4
CONTROLLER_TYPE_NINTENDO_SWITCH_PRO =
5
CONTROLLER_TYPE_VIRTUAL =
6
CONTROLLER_TYPE_PS5 =
7
CONTROLLER_TYPE_AMAZON_LUNA =
8
CONTROLLER_TYPE_GOOGLE_STADIA =
9
CONTROLLER_TYPE_NVIDIA_SHIELD =
10
CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_LEFT =
11
CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_RIGHT =
12
CONTROLLER_TYPE_NINTENDO_SWITCH_JOYCON_PAIR =
13
CONTROLLER_TYPE_MAX =
14
CONTROLLER_BINDTYPE_NONE =
0
CONTROLLER_BINDTYPE_BUTTON =
1
CONTROLLER_BINDTYPE_AXIS =
2
CONTROLLER_BINDTYPE_HAT =
3
CONTROLLER_AXIS_INVALID =
-1
CONTROLLER_AXIS_LEFTX =
0
CONTROLLER_AXIS_LEFTY =
1
CONTROLLER_AXIS_RIGHTX =
2
CONTROLLER_AXIS_RIGHTY =
3
CONTROLLER_AXIS_TRIGGERLEFT =
4
CONTROLLER_AXIS_TRIGGERRIGHT =
5
CONTROLLER_AXIS_MAX =
6
CONTROLLER_BUTTON_INVALID =
-1
CONTROLLER_BUTTON_A =
0
CONTROLLER_BUTTON_B =
1
CONTROLLER_BUTTON_X =
2
CONTROLLER_BUTTON_Y =
3
CONTROLLER_BUTTON_BACK =
4
CONTROLLER_BUTTON_GUIDE =
5
CONTROLLER_BUTTON_START =
6
CONTROLLER_BUTTON_LEFTSTICK =
7
CONTROLLER_BUTTON_RIGHTSTICK =
8
CONTROLLER_BUTTON_LEFTSHOULDER =
9
CONTROLLER_BUTTON_RIGHTSHOULDER =
10
CONTROLLER_BUTTON_DPAD_UP =
11
CONTROLLER_BUTTON_DPAD_DOWN =
12
CONTROLLER_BUTTON_DPAD_LEFT =
13
CONTROLLER_BUTTON_DPAD_RIGHT =
14
CONTROLLER_BUTTON_MISC1 =
15
CONTROLLER_BUTTON_PADDLE1 =
16
CONTROLLER_BUTTON_PADDLE2 =
17
CONTROLLER_BUTTON_PADDLE3 =
18
CONTROLLER_BUTTON_PADDLE4 =
19
CONTROLLER_BUTTON_TOUCHPAD =
20
CONTROLLER_BUTTON_MAX =
21
@@sdl2_import_done =
false

Class Method Summary collapse

Class Method Details

.load_lib(libpath, output_error = false, image_libpath: nil, ttf_libpath: nil, mixer_libpath: nil, gfx_libpath: nil, sound_libpath: nil) ⇒ Object



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/sdl2.rb', line 61

def self.load_lib(libpath, output_error = false, image_libpath: nil, ttf_libpath: nil, mixer_libpath: nil, gfx_libpath: nil, sound_libpath: nil)

  unless @@sdl2_import_done
    # Ref.: Using Multiple and Alternate Libraries
    # https://github.com/ffi/ffi/wiki/Using-Multiple-and-Alternate-Libraries
    begin
      lib_paths = [libpath, image_libpath, ttf_libpath, mixer_libpath, gfx_libpath, sound_libpath].compact

      ffi_lib_flags :now, :global
      ffi_lib *lib_paths
      setup_symbols(output_error)

      setup_image_symbols(output_error) if image_libpath
      setup_ttf_symbols(output_error) if ttf_libpath
      setup_mixer_symbols(output_error) if mixer_libpath

      if gfx_libpath != nil
        setup_gfx_framerate_symbols(output_error)
        setup_gfx_primitives_symbols(output_error)
        setup_gfx_imagefilter_symbols(output_error)
        setup_gfx_rotozoom_symbols(output_error)
      end

      setup_sound_symbols(output_error) if sound_libpath
    rescue => error
      $stderr.puts("[Warning] Failed to load libraries (#{error}).") if output_error
    end
  end

end

.PointInRect(p, r) ⇒ Object



20
21
22
# File 'lib/sdl2_rect.rb', line 20

def self.PointInRect(p, r)
  return ( (p.x >= r.x) && (p.x < (r.x + r.w)) && (p.y >= r.y) && (p.y < (r.y + r.h)) ) ? 1 : 0;
end

.RectEmpty(r) ⇒ Object



24
25
26
# File 'lib/sdl2_rect.rb', line 24

def self.RectEmpty(r)
  return (!r.null? || (r.w <= 0) || (r.h <= 0)) ? 1 : 0
end

.RectEquals(a, b) ⇒ Object



28
29
30
# File 'lib/sdl2_rect.rb', line 28

def self.RectEquals(a, b)
  return (!a.null? && !b.null? && (a.x == b.x) && (a.y == b.y) && (a.w == b.w) && (a.h == b.h)) ? 1 : 0
end

.setup_audio_symbols(output_error = false) ⇒ Object

Function



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/sdl2_audio.rb', line 92

def self.setup_audio_symbols(output_error = false)
  symbols = [
    :SDL_GetNumAudioDrivers,
    :SDL_GetAudioDriver,
    :SDL_AudioInit,
    :SDL_AudioQuit,
    :SDL_GetCurrentAudioDriver,
    :SDL_OpenAudio,
    :SDL_GetNumAudioDevices,
    :SDL_GetAudioDeviceName,
    :SDL_GetAudioDeviceSpec,
    :SDL_GetDefaultAudioInfo,
    :SDL_OpenAudioDevice,
    :SDL_GetAudioStatus,
    :SDL_GetAudioDeviceStatus,
    :SDL_PauseAudio,
    :SDL_PauseAudioDevice,
    :SDL_LoadWAV_RW,
    :SDL_FreeWAV,
    :SDL_BuildAudioCVT,
    :SDL_ConvertAudio,
    :SDL_NewAudioStream,
    :SDL_AudioStreamPut,
    :SDL_AudioStreamGet,
    :SDL_AudioStreamAvailable,
    :SDL_AudioStreamFlush,
    :SDL_AudioStreamClear,
    :SDL_FreeAudioStream,
    :SDL_MixAudio,
    :SDL_MixAudioFormat,
    :SDL_QueueAudio,
    :SDL_DequeueAudio,
    :SDL_GetQueuedAudioSize,
    :SDL_ClearQueuedAudio,
    :SDL_LockAudio,
    :SDL_LockAudioDevice,
    :SDL_UnlockAudio,
    :SDL_UnlockAudioDevice,
    :SDL_CloseAudio,
    :SDL_CloseAudioDevice,
  ]
  apis = {
    :SDL_GetNumAudioDrivers => :GetNumAudioDrivers,
    :SDL_GetAudioDriver => :GetAudioDriver,
    :SDL_AudioInit => :AudioInit,
    :SDL_AudioQuit => :AudioQuit,
    :SDL_GetCurrentAudioDriver => :GetCurrentAudioDriver,
    :SDL_OpenAudio => :OpenAudio,
    :SDL_GetNumAudioDevices => :GetNumAudioDevices,
    :SDL_GetAudioDeviceName => :GetAudioDeviceName,
    :SDL_GetAudioDeviceSpec => :GetAudioDeviceSpec,
    :SDL_GetDefaultAudioInfo => :GetDefaultAudioInfo,
    :SDL_OpenAudioDevice => :OpenAudioDevice,
    :SDL_GetAudioStatus => :GetAudioStatus,
    :SDL_GetAudioDeviceStatus => :GetAudioDeviceStatus,
    :SDL_PauseAudio => :PauseAudio,
    :SDL_PauseAudioDevice => :PauseAudioDevice,
    :SDL_LoadWAV_RW => :LoadWAV_RW,
    :SDL_FreeWAV => :FreeWAV,
    :SDL_BuildAudioCVT => :BuildAudioCVT,
    :SDL_ConvertAudio => :ConvertAudio,
    :SDL_NewAudioStream => :NewAudioStream,
    :SDL_AudioStreamPut => :AudioStreamPut,
    :SDL_AudioStreamGet => :AudioStreamGet,
    :SDL_AudioStreamAvailable => :AudioStreamAvailable,
    :SDL_AudioStreamFlush => :AudioStreamFlush,
    :SDL_AudioStreamClear => :AudioStreamClear,
    :SDL_FreeAudioStream => :FreeAudioStream,
    :SDL_MixAudio => :MixAudio,
    :SDL_MixAudioFormat => :MixAudioFormat,
    :SDL_QueueAudio => :QueueAudio,
    :SDL_DequeueAudio => :DequeueAudio,
    :SDL_GetQueuedAudioSize => :GetQueuedAudioSize,
    :SDL_ClearQueuedAudio => :ClearQueuedAudio,
    :SDL_LockAudio => :LockAudio,
    :SDL_LockAudioDevice => :LockAudioDevice,
    :SDL_UnlockAudio => :UnlockAudio,
    :SDL_UnlockAudioDevice => :UnlockAudioDevice,
    :SDL_CloseAudio => :CloseAudio,
    :SDL_CloseAudioDevice => :CloseAudioDevice,
  }
  args = {
    :SDL_GetNumAudioDrivers => [],
    :SDL_GetAudioDriver => [:int],
    :SDL_AudioInit => [:pointer],
    :SDL_AudioQuit => [],
    :SDL_GetCurrentAudioDriver => [],
    :SDL_OpenAudio => [:pointer, :pointer],
    :SDL_GetNumAudioDevices => [:int],
    :SDL_GetAudioDeviceName => [:int, :int],
    :SDL_GetAudioDeviceSpec => [:int, :int, :pointer],
    :SDL_GetDefaultAudioInfo => [:pointer, :pointer, :int],
    :SDL_OpenAudioDevice => [:pointer, :int, :pointer, :pointer, :int],
    :SDL_GetAudioStatus => [],
    :SDL_GetAudioDeviceStatus => [:uint],
    :SDL_PauseAudio => [:int],
    :SDL_PauseAudioDevice => [:uint, :int],
    :SDL_LoadWAV_RW => [:pointer, :int, :pointer, :pointer, :pointer],
    :SDL_FreeWAV => [:pointer],
    :SDL_BuildAudioCVT => [:pointer, :ushort, :uchar, :int, :ushort, :uchar, :int],
    :SDL_ConvertAudio => [:pointer],
    :SDL_NewAudioStream => [:ushort, :uchar, :int, :ushort, :uchar, :int],
    :SDL_AudioStreamPut => [:pointer, :pointer, :int],
    :SDL_AudioStreamGet => [:pointer, :pointer, :int],
    :SDL_AudioStreamAvailable => [:pointer],
    :SDL_AudioStreamFlush => [:pointer],
    :SDL_AudioStreamClear => [:pointer],
    :SDL_FreeAudioStream => [:pointer],
    :SDL_MixAudio => [:pointer, :pointer, :uint, :int],
    :SDL_MixAudioFormat => [:pointer, :pointer, :ushort, :uint, :int],
    :SDL_QueueAudio => [:uint, :pointer, :uint],
    :SDL_DequeueAudio => [:uint, :pointer, :uint],
    :SDL_GetQueuedAudioSize => [:uint],
    :SDL_ClearQueuedAudio => [:uint],
    :SDL_LockAudio => [],
    :SDL_LockAudioDevice => [:uint],
    :SDL_UnlockAudio => [],
    :SDL_UnlockAudioDevice => [:uint],
    :SDL_CloseAudio => [],
    :SDL_CloseAudioDevice => [:uint],
  }
  retvals = {
    :SDL_GetNumAudioDrivers => :int,
    :SDL_GetAudioDriver => :pointer,
    :SDL_AudioInit => :int,
    :SDL_AudioQuit => :void,
    :SDL_GetCurrentAudioDriver => :pointer,
    :SDL_OpenAudio => :int,
    :SDL_GetNumAudioDevices => :int,
    :SDL_GetAudioDeviceName => :pointer,
    :SDL_GetAudioDeviceSpec => :int,
    :SDL_GetDefaultAudioInfo => :int,
    :SDL_OpenAudioDevice => :uint,
    :SDL_GetAudioStatus => :int,
    :SDL_GetAudioDeviceStatus => :int,
    :SDL_PauseAudio => :void,
    :SDL_PauseAudioDevice => :void,
    :SDL_LoadWAV_RW => :pointer,
    :SDL_FreeWAV => :void,
    :SDL_BuildAudioCVT => :int,
    :SDL_ConvertAudio => :int,
    :SDL_NewAudioStream => :pointer,
    :SDL_AudioStreamPut => :int,
    :SDL_AudioStreamGet => :int,
    :SDL_AudioStreamAvailable => :int,
    :SDL_AudioStreamFlush => :int,
    :SDL_AudioStreamClear => :void,
    :SDL_FreeAudioStream => :void,
    :SDL_MixAudio => :void,
    :SDL_MixAudioFormat => :void,
    :SDL_QueueAudio => :int,
    :SDL_DequeueAudio => :uint,
    :SDL_GetQueuedAudioSize => :uint,
    :SDL_ClearQueuedAudio => :void,
    :SDL_LockAudio => :void,
    :SDL_LockAudioDevice => :void,
    :SDL_UnlockAudio => :void,
    :SDL_UnlockAudioDevice => :void,
    :SDL_CloseAudio => :void,
    :SDL_CloseAudioDevice => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_blendmode_symbols(output_error = false) ⇒ Object

Function



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/sdl2_blendmode.rb', line 49

def self.setup_blendmode_symbols(output_error = false)
  symbols = [
    :SDL_ComposeCustomBlendMode,
  ]
  apis = {
    :SDL_ComposeCustomBlendMode => :ComposeCustomBlendMode,
  }
  args = {
    :SDL_ComposeCustomBlendMode => [:int, :int, :int, :int, :int, :int],
  }
  retvals = {
    :SDL_ComposeCustomBlendMode => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_clipboard_symbols(output_error = false) ⇒ Object

Function



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/sdl2_clipboard.rb', line 25

def self.setup_clipboard_symbols(output_error = false)
  symbols = [
    :SDL_SetClipboardText,
    :SDL_GetClipboardText,
    :SDL_HasClipboardText,
    :SDL_SetPrimarySelectionText,
    :SDL_GetPrimarySelectionText,
    :SDL_HasPrimarySelectionText,
  ]
  apis = {
    :SDL_SetClipboardText => :SetClipboardText,
    :SDL_GetClipboardText => :GetClipboardText,
    :SDL_HasClipboardText => :HasClipboardText,
    :SDL_SetPrimarySelectionText => :SetPrimarySelectionText,
    :SDL_GetPrimarySelectionText => :GetPrimarySelectionText,
    :SDL_HasPrimarySelectionText => :HasPrimarySelectionText,
  }
  args = {
    :SDL_SetClipboardText => [:pointer],
    :SDL_GetClipboardText => [],
    :SDL_HasClipboardText => [],
    :SDL_SetPrimarySelectionText => [:pointer],
    :SDL_GetPrimarySelectionText => [],
    :SDL_HasPrimarySelectionText => [],
  }
  retvals = {
    :SDL_SetClipboardText => :int,
    :SDL_GetClipboardText => :pointer,
    :SDL_HasClipboardText => :int,
    :SDL_SetPrimarySelectionText => :int,
    :SDL_GetPrimarySelectionText => :pointer,
    :SDL_HasPrimarySelectionText => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_cpuinfo_symbols(output_error = false) ⇒ Object

Function



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/sdl2_cpuinfo.rb', line 26

def self.setup_cpuinfo_symbols(output_error = false)
  symbols = [
    :SDL_GetCPUCount,
    :SDL_GetCPUCacheLineSize,
    :SDL_HasRDTSC,
    :SDL_HasAltiVec,
    :SDL_HasMMX,
    :SDL_Has3DNow,
    :SDL_HasSSE,
    :SDL_HasSSE2,
    :SDL_HasSSE3,
    :SDL_HasSSE41,
    :SDL_HasSSE42,
    :SDL_HasAVX,
    :SDL_HasAVX2,
    :SDL_HasAVX512F,
    :SDL_HasARMSIMD,
    :SDL_HasNEON,
    :SDL_HasLSX,
    :SDL_HasLASX,
    :SDL_GetSystemRAM,
    :SDL_SIMDGetAlignment,
    :SDL_SIMDAlloc,
    :SDL_SIMDRealloc,
    :SDL_SIMDFree,
  ]
  apis = {
    :SDL_GetCPUCount => :GetCPUCount,
    :SDL_GetCPUCacheLineSize => :GetCPUCacheLineSize,
    :SDL_HasRDTSC => :HasRDTSC,
    :SDL_HasAltiVec => :HasAltiVec,
    :SDL_HasMMX => :HasMMX,
    :SDL_Has3DNow => :Has3DNow,
    :SDL_HasSSE => :HasSSE,
    :SDL_HasSSE2 => :HasSSE2,
    :SDL_HasSSE3 => :HasSSE3,
    :SDL_HasSSE41 => :HasSSE41,
    :SDL_HasSSE42 => :HasSSE42,
    :SDL_HasAVX => :HasAVX,
    :SDL_HasAVX2 => :HasAVX2,
    :SDL_HasAVX512F => :HasAVX512F,
    :SDL_HasARMSIMD => :HasARMSIMD,
    :SDL_HasNEON => :HasNEON,
    :SDL_HasLSX => :HasLSX,
    :SDL_HasLASX => :HasLASX,
    :SDL_GetSystemRAM => :GetSystemRAM,
    :SDL_SIMDGetAlignment => :SIMDGetAlignment,
    :SDL_SIMDAlloc => :SIMDAlloc,
    :SDL_SIMDRealloc => :SIMDRealloc,
    :SDL_SIMDFree => :SIMDFree,
  }
  args = {
    :SDL_GetCPUCount => [],
    :SDL_GetCPUCacheLineSize => [],
    :SDL_HasRDTSC => [],
    :SDL_HasAltiVec => [],
    :SDL_HasMMX => [],
    :SDL_Has3DNow => [],
    :SDL_HasSSE => [],
    :SDL_HasSSE2 => [],
    :SDL_HasSSE3 => [],
    :SDL_HasSSE41 => [],
    :SDL_HasSSE42 => [],
    :SDL_HasAVX => [],
    :SDL_HasAVX2 => [],
    :SDL_HasAVX512F => [],
    :SDL_HasARMSIMD => [],
    :SDL_HasNEON => [],
    :SDL_HasLSX => [],
    :SDL_HasLASX => [],
    :SDL_GetSystemRAM => [],
    :SDL_SIMDGetAlignment => [],
    :SDL_SIMDAlloc => [:ulong],
    :SDL_SIMDRealloc => [:pointer, :ulong],
    :SDL_SIMDFree => [:pointer],
  }
  retvals = {
    :SDL_GetCPUCount => :int,
    :SDL_GetCPUCacheLineSize => :int,
    :SDL_HasRDTSC => :int,
    :SDL_HasAltiVec => :int,
    :SDL_HasMMX => :int,
    :SDL_Has3DNow => :int,
    :SDL_HasSSE => :int,
    :SDL_HasSSE2 => :int,
    :SDL_HasSSE3 => :int,
    :SDL_HasSSE41 => :int,
    :SDL_HasSSE42 => :int,
    :SDL_HasAVX => :int,
    :SDL_HasAVX2 => :int,
    :SDL_HasAVX512F => :int,
    :SDL_HasARMSIMD => :int,
    :SDL_HasNEON => :int,
    :SDL_HasLSX => :int,
    :SDL_HasLASX => :int,
    :SDL_GetSystemRAM => :int,
    :SDL_SIMDGetAlignment => :ulong,
    :SDL_SIMDAlloc => :pointer,
    :SDL_SIMDRealloc => :pointer,
    :SDL_SIMDFree => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_error_symbols(output_error = false) ⇒ Object

Function



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/sdl2_error.rb', line 32

def self.setup_error_symbols(output_error = false)
  symbols = [
    :SDL_SetError,
    :SDL_GetError,
    :SDL_GetErrorMsg,
    :SDL_ClearError,
    :SDL_Error,
  ]
  apis = {
    :SDL_SetError => :SetError,
    :SDL_GetError => :GetError,
    :SDL_GetErrorMsg => :GetErrorMsg,
    :SDL_ClearError => :ClearError,
    :SDL_Error => :Error,
  }
  args = {
    :SDL_SetError => [:pointer],
    :SDL_GetError => [],
    :SDL_GetErrorMsg => [:pointer, :int],
    :SDL_ClearError => [],
    :SDL_Error => [:int],
  }
  retvals = {
    :SDL_SetError => :int,
    :SDL_GetError => :pointer,
    :SDL_GetErrorMsg => :pointer,
    :SDL_ClearError => :void,
    :SDL_Error => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_events_symbols(output_error = false) ⇒ Object

Function



487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/sdl2_events.rb', line 487

def self.setup_events_symbols(output_error = false)
  symbols = [
    :SDL_PumpEvents,
    :SDL_PeepEvents,
    :SDL_HasEvent,
    :SDL_HasEvents,
    :SDL_FlushEvent,
    :SDL_FlushEvents,
    :SDL_PollEvent,
    :SDL_WaitEvent,
    :SDL_WaitEventTimeout,
    :SDL_PushEvent,
    :SDL_SetEventFilter,
    :SDL_GetEventFilter,
    :SDL_AddEventWatch,
    :SDL_DelEventWatch,
    :SDL_FilterEvents,
    :SDL_EventState,
    :SDL_RegisterEvents,
  ]
  apis = {
    :SDL_PumpEvents => :PumpEvents,
    :SDL_PeepEvents => :PeepEvents,
    :SDL_HasEvent => :HasEvent,
    :SDL_HasEvents => :HasEvents,
    :SDL_FlushEvent => :FlushEvent,
    :SDL_FlushEvents => :FlushEvents,
    :SDL_PollEvent => :PollEvent,
    :SDL_WaitEvent => :WaitEvent,
    :SDL_WaitEventTimeout => :WaitEventTimeout,
    :SDL_PushEvent => :PushEvent,
    :SDL_SetEventFilter => :SetEventFilter,
    :SDL_GetEventFilter => :GetEventFilter,
    :SDL_AddEventWatch => :AddEventWatch,
    :SDL_DelEventWatch => :DelEventWatch,
    :SDL_FilterEvents => :FilterEvents,
    :SDL_EventState => :EventState,
    :SDL_RegisterEvents => :RegisterEvents,
  }
  args = {
    :SDL_PumpEvents => [],
    :SDL_PeepEvents => [:pointer, :int, :int, :uint, :uint],
    :SDL_HasEvent => [:uint],
    :SDL_HasEvents => [:uint, :uint],
    :SDL_FlushEvent => [:uint],
    :SDL_FlushEvents => [:uint, :uint],
    :SDL_PollEvent => [:pointer],
    :SDL_WaitEvent => [:pointer],
    :SDL_WaitEventTimeout => [:pointer, :int],
    :SDL_PushEvent => [:pointer],
    :SDL_SetEventFilter => [:SDL_EventFilter, :pointer],
    :SDL_GetEventFilter => [:pointer, :pointer],
    :SDL_AddEventWatch => [:SDL_EventFilter, :pointer],
    :SDL_DelEventWatch => [:SDL_EventFilter, :pointer],
    :SDL_FilterEvents => [:SDL_EventFilter, :pointer],
    :SDL_EventState => [:uint, :int],
    :SDL_RegisterEvents => [:int],
  }
  retvals = {
    :SDL_PumpEvents => :void,
    :SDL_PeepEvents => :int,
    :SDL_HasEvent => :int,
    :SDL_HasEvents => :int,
    :SDL_FlushEvent => :void,
    :SDL_FlushEvents => :void,
    :SDL_PollEvent => :int,
    :SDL_WaitEvent => :int,
    :SDL_WaitEventTimeout => :int,
    :SDL_PushEvent => :int,
    :SDL_SetEventFilter => :void,
    :SDL_GetEventFilter => :int,
    :SDL_AddEventWatch => :void,
    :SDL_DelEventWatch => :void,
    :SDL_FilterEvents => :void,
    :SDL_EventState => :uchar,
    :SDL_RegisterEvents => :uint,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_filesystem_symbols(output_error = false) ⇒ Object

Function



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/sdl2_filesystem.rb', line 25

def self.setup_filesystem_symbols(output_error = false)
  symbols = [
    :SDL_GetBasePath,
    :SDL_GetPrefPath,
  ]
  apis = {
    :SDL_GetBasePath => :GetBasePath,
    :SDL_GetPrefPath => :GetPrefPath,
  }
  args = {
    :SDL_GetBasePath => [],
    :SDL_GetPrefPath => [:pointer, :pointer],
  }
  retvals = {
    :SDL_GetBasePath => :pointer,
    :SDL_GetPrefPath => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_gamecontroller_symbols(output_error = false) ⇒ Object

Function



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
# File 'lib/sdl2_gamecontroller.rb', line 103

def self.setup_gamecontroller_symbols(output_error = false)
  symbols = [
    :SDL_GameControllerAddMappingsFromRW,
    :SDL_GameControllerAddMapping,
    :SDL_GameControllerNumMappings,
    :SDL_GameControllerMappingForIndex,
    :SDL_GameControllerMappingForGUID,
    :SDL_GameControllerMapping,
    :SDL_IsGameController,
    :SDL_GameControllerNameForIndex,
    :SDL_GameControllerPathForIndex,
    :SDL_GameControllerTypeForIndex,
    :SDL_GameControllerMappingForDeviceIndex,
    :SDL_GameControllerOpen,
    :SDL_GameControllerFromInstanceID,
    :SDL_GameControllerFromPlayerIndex,
    :SDL_GameControllerName,
    :SDL_GameControllerPath,
    :SDL_GameControllerGetType,
    :SDL_GameControllerGetPlayerIndex,
    :SDL_GameControllerSetPlayerIndex,
    :SDL_GameControllerGetVendor,
    :SDL_GameControllerGetProduct,
    :SDL_GameControllerGetProductVersion,
    :SDL_GameControllerGetFirmwareVersion,
    :SDL_GameControllerGetSerial,
    :SDL_GameControllerGetSteamHandle,
    :SDL_GameControllerGetAttached,
    :SDL_GameControllerGetJoystick,
    :SDL_GameControllerEventState,
    :SDL_GameControllerUpdate,
    :SDL_GameControllerGetAxisFromString,
    :SDL_GameControllerGetStringForAxis,
    :SDL_GameControllerGetBindForAxis,
    :SDL_GameControllerHasAxis,
    :SDL_GameControllerGetAxis,
    :SDL_GameControllerGetButtonFromString,
    :SDL_GameControllerGetStringForButton,
    :SDL_GameControllerGetBindForButton,
    :SDL_GameControllerHasButton,
    :SDL_GameControllerGetButton,
    :SDL_GameControllerGetNumTouchpads,
    :SDL_GameControllerGetNumTouchpadFingers,
    :SDL_GameControllerGetTouchpadFinger,
    :SDL_GameControllerHasSensor,
    :SDL_GameControllerSetSensorEnabled,
    :SDL_GameControllerIsSensorEnabled,
    :SDL_GameControllerGetSensorDataRate,
    :SDL_GameControllerGetSensorData,
    :SDL_GameControllerGetSensorDataWithTimestamp,
    :SDL_GameControllerRumble,
    :SDL_GameControllerRumbleTriggers,
    :SDL_GameControllerHasLED,
    :SDL_GameControllerHasRumble,
    :SDL_GameControllerHasRumbleTriggers,
    :SDL_GameControllerSetLED,
    :SDL_GameControllerSendEffect,
    :SDL_GameControllerClose,
    :SDL_GameControllerGetAppleSFSymbolsNameForButton,
    :SDL_GameControllerGetAppleSFSymbolsNameForAxis,
  ]
  apis = {
    :SDL_GameControllerAddMappingsFromRW => :GameControllerAddMappingsFromRW,
    :SDL_GameControllerAddMapping => :GameControllerAddMapping,
    :SDL_GameControllerNumMappings => :GameControllerNumMappings,
    :SDL_GameControllerMappingForIndex => :GameControllerMappingForIndex,
    :SDL_GameControllerMappingForGUID => :GameControllerMappingForGUID,
    :SDL_GameControllerMapping => :GameControllerMapping,
    :SDL_IsGameController => :IsGameController,
    :SDL_GameControllerNameForIndex => :GameControllerNameForIndex,
    :SDL_GameControllerPathForIndex => :GameControllerPathForIndex,
    :SDL_GameControllerTypeForIndex => :GameControllerTypeForIndex,
    :SDL_GameControllerMappingForDeviceIndex => :GameControllerMappingForDeviceIndex,
    :SDL_GameControllerOpen => :GameControllerOpen,
    :SDL_GameControllerFromInstanceID => :GameControllerFromInstanceID,
    :SDL_GameControllerFromPlayerIndex => :GameControllerFromPlayerIndex,
    :SDL_GameControllerName => :GameControllerName,
    :SDL_GameControllerPath => :GameControllerPath,
    :SDL_GameControllerGetType => :GameControllerGetType,
    :SDL_GameControllerGetPlayerIndex => :GameControllerGetPlayerIndex,
    :SDL_GameControllerSetPlayerIndex => :GameControllerSetPlayerIndex,
    :SDL_GameControllerGetVendor => :GameControllerGetVendor,
    :SDL_GameControllerGetProduct => :GameControllerGetProduct,
    :SDL_GameControllerGetProductVersion => :GameControllerGetProductVersion,
    :SDL_GameControllerGetFirmwareVersion => :GameControllerGetFirmwareVersion,
    :SDL_GameControllerGetSerial => :GameControllerGetSerial,
    :SDL_GameControllerGetSteamHandle => :GameControllerGetSteamHandle,
    :SDL_GameControllerGetAttached => :GameControllerGetAttached,
    :SDL_GameControllerGetJoystick => :GameControllerGetJoystick,
    :SDL_GameControllerEventState => :GameControllerEventState,
    :SDL_GameControllerUpdate => :GameControllerUpdate,
    :SDL_GameControllerGetAxisFromString => :GameControllerGetAxisFromString,
    :SDL_GameControllerGetStringForAxis => :GameControllerGetStringForAxis,
    :SDL_GameControllerGetBindForAxis => :GameControllerGetBindForAxis,
    :SDL_GameControllerHasAxis => :GameControllerHasAxis,
    :SDL_GameControllerGetAxis => :GameControllerGetAxis,
    :SDL_GameControllerGetButtonFromString => :GameControllerGetButtonFromString,
    :SDL_GameControllerGetStringForButton => :GameControllerGetStringForButton,
    :SDL_GameControllerGetBindForButton => :GameControllerGetBindForButton,
    :SDL_GameControllerHasButton => :GameControllerHasButton,
    :SDL_GameControllerGetButton => :GameControllerGetButton,
    :SDL_GameControllerGetNumTouchpads => :GameControllerGetNumTouchpads,
    :SDL_GameControllerGetNumTouchpadFingers => :GameControllerGetNumTouchpadFingers,
    :SDL_GameControllerGetTouchpadFinger => :GameControllerGetTouchpadFinger,
    :SDL_GameControllerHasSensor => :GameControllerHasSensor,
    :SDL_GameControllerSetSensorEnabled => :GameControllerSetSensorEnabled,
    :SDL_GameControllerIsSensorEnabled => :GameControllerIsSensorEnabled,
    :SDL_GameControllerGetSensorDataRate => :GameControllerGetSensorDataRate,
    :SDL_GameControllerGetSensorData => :GameControllerGetSensorData,
    :SDL_GameControllerGetSensorDataWithTimestamp => :GameControllerGetSensorDataWithTimestamp,
    :SDL_GameControllerRumble => :GameControllerRumble,
    :SDL_GameControllerRumbleTriggers => :GameControllerRumbleTriggers,
    :SDL_GameControllerHasLED => :GameControllerHasLED,
    :SDL_GameControllerHasRumble => :GameControllerHasRumble,
    :SDL_GameControllerHasRumbleTriggers => :GameControllerHasRumbleTriggers,
    :SDL_GameControllerSetLED => :GameControllerSetLED,
    :SDL_GameControllerSendEffect => :GameControllerSendEffect,
    :SDL_GameControllerClose => :GameControllerClose,
    :SDL_GameControllerGetAppleSFSymbolsNameForButton => :GameControllerGetAppleSFSymbolsNameForButton,
    :SDL_GameControllerGetAppleSFSymbolsNameForAxis => :GameControllerGetAppleSFSymbolsNameForAxis,
  }
  args = {
    :SDL_GameControllerAddMappingsFromRW => [:pointer, :int],
    :SDL_GameControllerAddMapping => [:pointer],
    :SDL_GameControllerNumMappings => [],
    :SDL_GameControllerMappingForIndex => [:int],
    :SDL_GameControllerMappingForGUID => [JoystickGUID.by_value],
    :SDL_GameControllerMapping => [:pointer],
    :SDL_IsGameController => [:int],
    :SDL_GameControllerNameForIndex => [:int],
    :SDL_GameControllerPathForIndex => [:int],
    :SDL_GameControllerTypeForIndex => [:int],
    :SDL_GameControllerMappingForDeviceIndex => [:int],
    :SDL_GameControllerOpen => [:int],
    :SDL_GameControllerFromInstanceID => [:int],
    :SDL_GameControllerFromPlayerIndex => [:int],
    :SDL_GameControllerName => [:pointer],
    :SDL_GameControllerPath => [:pointer],
    :SDL_GameControllerGetType => [:pointer],
    :SDL_GameControllerGetPlayerIndex => [:pointer],
    :SDL_GameControllerSetPlayerIndex => [:pointer, :int],
    :SDL_GameControllerGetVendor => [:pointer],
    :SDL_GameControllerGetProduct => [:pointer],
    :SDL_GameControllerGetProductVersion => [:pointer],
    :SDL_GameControllerGetFirmwareVersion => [:pointer],
    :SDL_GameControllerGetSerial => [:pointer],
    :SDL_GameControllerGetSteamHandle => [:pointer],
    :SDL_GameControllerGetAttached => [:pointer],
    :SDL_GameControllerGetJoystick => [:pointer],
    :SDL_GameControllerEventState => [:int],
    :SDL_GameControllerUpdate => [],
    :SDL_GameControllerGetAxisFromString => [:pointer],
    :SDL_GameControllerGetStringForAxis => [:int],
    :SDL_GameControllerGetBindForAxis => [:pointer, :int],
    :SDL_GameControllerHasAxis => [:pointer, :int],
    :SDL_GameControllerGetAxis => [:pointer, :int],
    :SDL_GameControllerGetButtonFromString => [:pointer],
    :SDL_GameControllerGetStringForButton => [:int],
    :SDL_GameControllerGetBindForButton => [:pointer, :int],
    :SDL_GameControllerHasButton => [:pointer, :int],
    :SDL_GameControllerGetButton => [:pointer, :int],
    :SDL_GameControllerGetNumTouchpads => [:pointer],
    :SDL_GameControllerGetNumTouchpadFingers => [:pointer, :int],
    :SDL_GameControllerGetTouchpadFinger => [:pointer, :int, :int, :pointer, :pointer, :pointer, :pointer],
    :SDL_GameControllerHasSensor => [:pointer, :int],
    :SDL_GameControllerSetSensorEnabled => [:pointer, :int, :int],
    :SDL_GameControllerIsSensorEnabled => [:pointer, :int],
    :SDL_GameControllerGetSensorDataRate => [:pointer, :int],
    :SDL_GameControllerGetSensorData => [:pointer, :int, :pointer, :int],
    :SDL_GameControllerGetSensorDataWithTimestamp => [:pointer, :int, :pointer, :pointer, :int],
    :SDL_GameControllerRumble => [:pointer, :ushort, :ushort, :uint],
    :SDL_GameControllerRumbleTriggers => [:pointer, :ushort, :ushort, :uint],
    :SDL_GameControllerHasLED => [:pointer],
    :SDL_GameControllerHasRumble => [:pointer],
    :SDL_GameControllerHasRumbleTriggers => [:pointer],
    :SDL_GameControllerSetLED => [:pointer, :uchar, :uchar, :uchar],
    :SDL_GameControllerSendEffect => [:pointer, :pointer, :int],
    :SDL_GameControllerClose => [:pointer],
    :SDL_GameControllerGetAppleSFSymbolsNameForButton => [:pointer, :int],
    :SDL_GameControllerGetAppleSFSymbolsNameForAxis => [:pointer, :int],
  }
  retvals = {
    :SDL_GameControllerAddMappingsFromRW => :int,
    :SDL_GameControllerAddMapping => :int,
    :SDL_GameControllerNumMappings => :int,
    :SDL_GameControllerMappingForIndex => :pointer,
    :SDL_GameControllerMappingForGUID => :pointer,
    :SDL_GameControllerMapping => :pointer,
    :SDL_IsGameController => :int,
    :SDL_GameControllerNameForIndex => :pointer,
    :SDL_GameControllerPathForIndex => :pointer,
    :SDL_GameControllerTypeForIndex => :int,
    :SDL_GameControllerMappingForDeviceIndex => :pointer,
    :SDL_GameControllerOpen => :pointer,
    :SDL_GameControllerFromInstanceID => :pointer,
    :SDL_GameControllerFromPlayerIndex => :pointer,
    :SDL_GameControllerName => :pointer,
    :SDL_GameControllerPath => :pointer,
    :SDL_GameControllerGetType => :int,
    :SDL_GameControllerGetPlayerIndex => :int,
    :SDL_GameControllerSetPlayerIndex => :void,
    :SDL_GameControllerGetVendor => :ushort,
    :SDL_GameControllerGetProduct => :ushort,
    :SDL_GameControllerGetProductVersion => :ushort,
    :SDL_GameControllerGetFirmwareVersion => :ushort,
    :SDL_GameControllerGetSerial => :pointer,
    :SDL_GameControllerGetSteamHandle => :ulong_long,
    :SDL_GameControllerGetAttached => :int,
    :SDL_GameControllerGetJoystick => :pointer,
    :SDL_GameControllerEventState => :int,
    :SDL_GameControllerUpdate => :void,
    :SDL_GameControllerGetAxisFromString => :int,
    :SDL_GameControllerGetStringForAxis => :pointer,
    :SDL_GameControllerGetBindForAxis => GameControllerButtonBind.by_value,
    :SDL_GameControllerHasAxis => :int,
    :SDL_GameControllerGetAxis => :short,
    :SDL_GameControllerGetButtonFromString => :int,
    :SDL_GameControllerGetStringForButton => :pointer,
    :SDL_GameControllerGetBindForButton => GameControllerButtonBind.by_value,
    :SDL_GameControllerHasButton => :int,
    :SDL_GameControllerGetButton => :uchar,
    :SDL_GameControllerGetNumTouchpads => :int,
    :SDL_GameControllerGetNumTouchpadFingers => :int,
    :SDL_GameControllerGetTouchpadFinger => :int,
    :SDL_GameControllerHasSensor => :int,
    :SDL_GameControllerSetSensorEnabled => :int,
    :SDL_GameControllerIsSensorEnabled => :int,
    :SDL_GameControllerGetSensorDataRate => :float,
    :SDL_GameControllerGetSensorData => :int,
    :SDL_GameControllerGetSensorDataWithTimestamp => :int,
    :SDL_GameControllerRumble => :int,
    :SDL_GameControllerRumbleTriggers => :int,
    :SDL_GameControllerHasLED => :int,
    :SDL_GameControllerHasRumble => :int,
    :SDL_GameControllerHasRumbleTriggers => :int,
    :SDL_GameControllerSetLED => :int,
    :SDL_GameControllerSendEffect => :int,
    :SDL_GameControllerClose => :void,
    :SDL_GameControllerGetAppleSFSymbolsNameForButton => :pointer,
    :SDL_GameControllerGetAppleSFSymbolsNameForAxis => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_gesture_symbols(output_error = false) ⇒ Object

Function



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/sdl2_gesture.rb', line 26

def self.setup_gesture_symbols(output_error = false)
  symbols = [
    :SDL_RecordGesture,
    :SDL_SaveAllDollarTemplates,
    :SDL_SaveDollarTemplate,
    :SDL_LoadDollarTemplates,
  ]
  apis = {
    :SDL_RecordGesture => :RecordGesture,
    :SDL_SaveAllDollarTemplates => :SaveAllDollarTemplates,
    :SDL_SaveDollarTemplate => :SaveDollarTemplate,
    :SDL_LoadDollarTemplates => :LoadDollarTemplates,
  }
  args = {
    :SDL_RecordGesture => [:long_long],
    :SDL_SaveAllDollarTemplates => [:pointer],
    :SDL_SaveDollarTemplate => [:long_long, :pointer],
    :SDL_LoadDollarTemplates => [:long_long, :pointer],
  }
  retvals = {
    :SDL_RecordGesture => :int,
    :SDL_SaveAllDollarTemplates => :int,
    :SDL_SaveDollarTemplate => :int,
    :SDL_LoadDollarTemplates => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_gfx_framerate_symbols(output_error = false) ⇒ Object

Function



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/sdl2_framerate.rb', line 35

def self.setup_gfx_framerate_symbols(output_error = false)
  symbols = [
    :SDL_initFramerate,
    :SDL_setFramerate,
    :SDL_getFramerate,
    :SDL_getFramecount,
    :SDL_framerateDelay,
  ]
  apis = {
    :SDL_initFramerate => :initFramerate,
    :SDL_setFramerate => :setFramerate,
    :SDL_getFramerate => :getFramerate,
    :SDL_getFramecount => :getFramecount,
    :SDL_framerateDelay => :framerateDelay,
  }
  args = {
    :SDL_initFramerate => [:pointer],
    :SDL_setFramerate => [:pointer, :uint],
    :SDL_getFramerate => [:pointer],
    :SDL_getFramecount => [:pointer],
    :SDL_framerateDelay => [:pointer],
  }
  retvals = {
    :SDL_initFramerate => :void,
    :SDL_setFramerate => :int,
    :SDL_getFramerate => :int,
    :SDL_getFramecount => :int,
    :SDL_framerateDelay => :uint,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_gfx_imagefilter_symbols(output_error = false) ⇒ Object

Function



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/sdl2_imageFilter.rb', line 25

def self.setup_gfx_imagefilter_symbols(output_error = false)
  symbols = [
    :SDL_imageFilterMMXdetect,
    :SDL_imageFilterMMXoff,
    :SDL_imageFilterMMXon,
    :SDL_imageFilterAdd,
    :SDL_imageFilterMean,
    :SDL_imageFilterSub,
    :SDL_imageFilterAbsDiff,
    :SDL_imageFilterMult,
    :SDL_imageFilterMultNor,
    :SDL_imageFilterMultDivby2,
    :SDL_imageFilterMultDivby4,
    :SDL_imageFilterBitAnd,
    :SDL_imageFilterBitOr,
    :SDL_imageFilterDiv,
    :SDL_imageFilterBitNegation,
    :SDL_imageFilterAddByte,
    :SDL_imageFilterAddUint,
    :SDL_imageFilterAddByteToHalf,
    :SDL_imageFilterSubByte,
    :SDL_imageFilterSubUint,
    :SDL_imageFilterShiftRight,
    :SDL_imageFilterShiftRightUint,
    :SDL_imageFilterMultByByte,
    :SDL_imageFilterShiftRightAndMultByByte,
    :SDL_imageFilterShiftLeftByte,
    :SDL_imageFilterShiftLeftUint,
    :SDL_imageFilterShiftLeft,
    :SDL_imageFilterBinarizeUsingThreshold,
    :SDL_imageFilterClipToRange,
    :SDL_imageFilterNormalizeLinear,
  ]
  apis = {
    :SDL_imageFilterMMXdetect => :imageFilterMMXdetect,
    :SDL_imageFilterMMXoff => :imageFilterMMXoff,
    :SDL_imageFilterMMXon => :imageFilterMMXon,
    :SDL_imageFilterAdd => :imageFilterAdd,
    :SDL_imageFilterMean => :imageFilterMean,
    :SDL_imageFilterSub => :imageFilterSub,
    :SDL_imageFilterAbsDiff => :imageFilterAbsDiff,
    :SDL_imageFilterMult => :imageFilterMult,
    :SDL_imageFilterMultNor => :imageFilterMultNor,
    :SDL_imageFilterMultDivby2 => :imageFilterMultDivby2,
    :SDL_imageFilterMultDivby4 => :imageFilterMultDivby4,
    :SDL_imageFilterBitAnd => :imageFilterBitAnd,
    :SDL_imageFilterBitOr => :imageFilterBitOr,
    :SDL_imageFilterDiv => :imageFilterDiv,
    :SDL_imageFilterBitNegation => :imageFilterBitNegation,
    :SDL_imageFilterAddByte => :imageFilterAddByte,
    :SDL_imageFilterAddUint => :imageFilterAddUint,
    :SDL_imageFilterAddByteToHalf => :imageFilterAddByteToHalf,
    :SDL_imageFilterSubByte => :imageFilterSubByte,
    :SDL_imageFilterSubUint => :imageFilterSubUint,
    :SDL_imageFilterShiftRight => :imageFilterShiftRight,
    :SDL_imageFilterShiftRightUint => :imageFilterShiftRightUint,
    :SDL_imageFilterMultByByte => :imageFilterMultByByte,
    :SDL_imageFilterShiftRightAndMultByByte => :imageFilterShiftRightAndMultByByte,
    :SDL_imageFilterShiftLeftByte => :imageFilterShiftLeftByte,
    :SDL_imageFilterShiftLeftUint => :imageFilterShiftLeftUint,
    :SDL_imageFilterShiftLeft => :imageFilterShiftLeft,
    :SDL_imageFilterBinarizeUsingThreshold => :imageFilterBinarizeUsingThreshold,
    :SDL_imageFilterClipToRange => :imageFilterClipToRange,
    :SDL_imageFilterNormalizeLinear => :imageFilterNormalizeLinear,
  }
  args = {
    :SDL_imageFilterMMXdetect => [],
    :SDL_imageFilterMMXoff => [],
    :SDL_imageFilterMMXon => [],
    :SDL_imageFilterAdd => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterMean => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterSub => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterAbsDiff => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterMult => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterMultNor => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterMultDivby2 => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterMultDivby4 => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterBitAnd => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterBitOr => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterDiv => [:pointer, :pointer, :pointer, :uint],
    :SDL_imageFilterBitNegation => [:pointer, :pointer, :uint],
    :SDL_imageFilterAddByte => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterAddUint => [:pointer, :pointer, :uint, :uint],
    :SDL_imageFilterAddByteToHalf => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterSubByte => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterSubUint => [:pointer, :pointer, :uint, :uint],
    :SDL_imageFilterShiftRight => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterShiftRightUint => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterMultByByte => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterShiftRightAndMultByByte => [:pointer, :pointer, :uint, :uchar, :uchar],
    :SDL_imageFilterShiftLeftByte => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterShiftLeftUint => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterShiftLeft => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterBinarizeUsingThreshold => [:pointer, :pointer, :uint, :uchar],
    :SDL_imageFilterClipToRange => [:pointer, :pointer, :uint, :uchar, :uchar],
    :SDL_imageFilterNormalizeLinear => [:pointer, :pointer, :uint, :int, :int, :int, :int],
  }
  retvals = {
    :SDL_imageFilterMMXdetect => :int,
    :SDL_imageFilterMMXoff => :void,
    :SDL_imageFilterMMXon => :void,
    :SDL_imageFilterAdd => :int,
    :SDL_imageFilterMean => :int,
    :SDL_imageFilterSub => :int,
    :SDL_imageFilterAbsDiff => :int,
    :SDL_imageFilterMult => :int,
    :SDL_imageFilterMultNor => :int,
    :SDL_imageFilterMultDivby2 => :int,
    :SDL_imageFilterMultDivby4 => :int,
    :SDL_imageFilterBitAnd => :int,
    :SDL_imageFilterBitOr => :int,
    :SDL_imageFilterDiv => :int,
    :SDL_imageFilterBitNegation => :int,
    :SDL_imageFilterAddByte => :int,
    :SDL_imageFilterAddUint => :int,
    :SDL_imageFilterAddByteToHalf => :int,
    :SDL_imageFilterSubByte => :int,
    :SDL_imageFilterSubUint => :int,
    :SDL_imageFilterShiftRight => :int,
    :SDL_imageFilterShiftRightUint => :int,
    :SDL_imageFilterMultByByte => :int,
    :SDL_imageFilterShiftRightAndMultByByte => :int,
    :SDL_imageFilterShiftLeftByte => :int,
    :SDL_imageFilterShiftLeftUint => :int,
    :SDL_imageFilterShiftLeft => :int,
    :SDL_imageFilterBinarizeUsingThreshold => :int,
    :SDL_imageFilterClipToRange => :int,
    :SDL_imageFilterNormalizeLinear => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_gfx_primitives_symbols(output_error = false) ⇒ Object

Function



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File 'lib/sdl2_gfxPrimitives.rb', line 28

def self.setup_gfx_primitives_symbols(output_error = false)
  symbols = [
    :pixelColor,
    :pixelRGBA,
    :hlineColor,
    :hlineRGBA,
    :vlineColor,
    :vlineRGBA,
    :rectangleColor,
    :rectangleRGBA,
    :roundedRectangleColor,
    :roundedRectangleRGBA,
    :boxColor,
    :boxRGBA,
    :roundedBoxColor,
    :roundedBoxRGBA,
    :lineColor,
    :lineRGBA,
    :aalineColor,
    :aalineRGBA,
    :thickLineColor,
    :thickLineRGBA,
    :circleColor,
    :circleRGBA,
    :arcColor,
    :arcRGBA,
    :aacircleColor,
    :aacircleRGBA,
    :filledCircleColor,
    :filledCircleRGBA,
    :ellipseColor,
    :ellipseRGBA,
    :aaellipseColor,
    :aaellipseRGBA,
    :filledEllipseColor,
    :filledEllipseRGBA,
    :pieColor,
    :pieRGBA,
    :filledPieColor,
    :filledPieRGBA,
    :trigonColor,
    :trigonRGBA,
    :aatrigonColor,
    :aatrigonRGBA,
    :filledTrigonColor,
    :filledTrigonRGBA,
    :polygonColor,
    :polygonRGBA,
    :aapolygonColor,
    :aapolygonRGBA,
    :filledPolygonColor,
    :filledPolygonRGBA,
    :texturedPolygon,
    :bezierColor,
    :bezierRGBA,
    :gfxPrimitivesSetFont,
    :gfxPrimitivesSetFontRotation,
    :characterColor,
    :characterRGBA,
    :stringColor,
    :stringRGBA,
  ]
  apis = {
    :pixelColor => :pixelColor,
    :pixelRGBA => :pixelRGBA,
    :hlineColor => :hlineColor,
    :hlineRGBA => :hlineRGBA,
    :vlineColor => :vlineColor,
    :vlineRGBA => :vlineRGBA,
    :rectangleColor => :rectangleColor,
    :rectangleRGBA => :rectangleRGBA,
    :roundedRectangleColor => :roundedRectangleColor,
    :roundedRectangleRGBA => :roundedRectangleRGBA,
    :boxColor => :boxColor,
    :boxRGBA => :boxRGBA,
    :roundedBoxColor => :roundedBoxColor,
    :roundedBoxRGBA => :roundedBoxRGBA,
    :lineColor => :lineColor,
    :lineRGBA => :lineRGBA,
    :aalineColor => :aalineColor,
    :aalineRGBA => :aalineRGBA,
    :thickLineColor => :thickLineColor,
    :thickLineRGBA => :thickLineRGBA,
    :circleColor => :circleColor,
    :circleRGBA => :circleRGBA,
    :arcColor => :arcColor,
    :arcRGBA => :arcRGBA,
    :aacircleColor => :aacircleColor,
    :aacircleRGBA => :aacircleRGBA,
    :filledCircleColor => :filledCircleColor,
    :filledCircleRGBA => :filledCircleRGBA,
    :ellipseColor => :ellipseColor,
    :ellipseRGBA => :ellipseRGBA,
    :aaellipseColor => :aaellipseColor,
    :aaellipseRGBA => :aaellipseRGBA,
    :filledEllipseColor => :filledEllipseColor,
    :filledEllipseRGBA => :filledEllipseRGBA,
    :pieColor => :pieColor,
    :pieRGBA => :pieRGBA,
    :filledPieColor => :filledPieColor,
    :filledPieRGBA => :filledPieRGBA,
    :trigonColor => :trigonColor,
    :trigonRGBA => :trigonRGBA,
    :aatrigonColor => :aatrigonColor,
    :aatrigonRGBA => :aatrigonRGBA,
    :filledTrigonColor => :filledTrigonColor,
    :filledTrigonRGBA => :filledTrigonRGBA,
    :polygonColor => :polygonColor,
    :polygonRGBA => :polygonRGBA,
    :aapolygonColor => :aapolygonColor,
    :aapolygonRGBA => :aapolygonRGBA,
    :filledPolygonColor => :filledPolygonColor,
    :filledPolygonRGBA => :filledPolygonRGBA,
    :texturedPolygon => :texturedPolygon,
    :bezierColor => :bezierColor,
    :bezierRGBA => :bezierRGBA,
    :gfxPrimitivesSetFont => :gfxPrimitivesSetFont,
    :gfxPrimitivesSetFontRotation => :gfxPrimitivesSetFontRotation,
    :characterColor => :characterColor,
    :characterRGBA => :characterRGBA,
    :stringColor => :stringColor,
    :stringRGBA => :stringRGBA,
  }
  args = {
    :pixelColor => [:pointer, :short, :short, :uint],
    :pixelRGBA => [:pointer, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :hlineColor => [:pointer, :short, :short, :short, :uint],
    :hlineRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :vlineColor => [:pointer, :short, :short, :short, :uint],
    :vlineRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :rectangleColor => [:pointer, :short, :short, :short, :short, :uint],
    :rectangleRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :roundedRectangleColor => [:pointer, :short, :short, :short, :short, :short, :uint],
    :roundedRectangleRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :boxColor => [:pointer, :short, :short, :short, :short, :uint],
    :boxRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :roundedBoxColor => [:pointer, :short, :short, :short, :short, :short, :uint],
    :roundedBoxRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :lineColor => [:pointer, :short, :short, :short, :short, :uint],
    :lineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :aalineColor => [:pointer, :short, :short, :short, :short, :uint],
    :aalineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :thickLineColor => [:pointer, :short, :short, :short, :short, :uchar, :uint],
    :thickLineRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar, :uchar],
    :circleColor => [:pointer, :short, :short, :short, :uint],
    :circleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :arcColor => [:pointer, :short, :short, :short, :short, :short, :uint],
    :arcRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :aacircleColor => [:pointer, :short, :short, :short, :uint],
    :aacircleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :filledCircleColor => [:pointer, :short, :short, :short, :uint],
    :filledCircleRGBA => [:pointer, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :ellipseColor => [:pointer, :short, :short, :short, :short, :uint],
    :ellipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :aaellipseColor => [:pointer, :short, :short, :short, :short, :uint],
    :aaellipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :filledEllipseColor => [:pointer, :short, :short, :short, :short, :uint],
    :filledEllipseRGBA => [:pointer, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :pieColor => [:pointer, :short, :short, :short, :short, :short, :uint],
    :pieRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :filledPieColor => [:pointer, :short, :short, :short, :short, :short, :uint],
    :filledPieRGBA => [:pointer, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :trigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
    :trigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :aatrigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
    :aatrigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :filledTrigonColor => [:pointer, :short, :short, :short, :short, :short, :short, :uint],
    :filledTrigonRGBA => [:pointer, :short, :short, :short, :short, :short, :short, :uchar, :uchar, :uchar, :uchar],
    :polygonColor => [:pointer, :pointer, :pointer, :int, :uint],
    :polygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
    :aapolygonColor => [:pointer, :pointer, :pointer, :int, :uint],
    :aapolygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
    :filledPolygonColor => [:pointer, :pointer, :pointer, :int, :uint],
    :filledPolygonRGBA => [:pointer, :pointer, :pointer, :int, :uchar, :uchar, :uchar, :uchar],
    :texturedPolygon => [:pointer, :pointer, :pointer, :int, :pointer, :int, :int],
    :bezierColor => [:pointer, :pointer, :pointer, :int, :int, :uint],
    :bezierRGBA => [:pointer, :pointer, :pointer, :int, :int, :uchar, :uchar, :uchar, :uchar],
    :gfxPrimitivesSetFont => [:pointer, :uint, :uint],
    :gfxPrimitivesSetFontRotation => [:uint],
    :characterColor => [:pointer, :short, :short, :char, :uint],
    :characterRGBA => [:pointer, :short, :short, :char, :uchar, :uchar, :uchar, :uchar],
    :stringColor => [:pointer, :short, :short, :pointer, :uint],
    :stringRGBA => [:pointer, :short, :short, :pointer, :uchar, :uchar, :uchar, :uchar],
  }
  retvals = {
    :pixelColor => :int,
    :pixelRGBA => :int,
    :hlineColor => :int,
    :hlineRGBA => :int,
    :vlineColor => :int,
    :vlineRGBA => :int,
    :rectangleColor => :int,
    :rectangleRGBA => :int,
    :roundedRectangleColor => :int,
    :roundedRectangleRGBA => :int,
    :boxColor => :int,
    :boxRGBA => :int,
    :roundedBoxColor => :int,
    :roundedBoxRGBA => :int,
    :lineColor => :int,
    :lineRGBA => :int,
    :aalineColor => :int,
    :aalineRGBA => :int,
    :thickLineColor => :int,
    :thickLineRGBA => :int,
    :circleColor => :int,
    :circleRGBA => :int,
    :arcColor => :int,
    :arcRGBA => :int,
    :aacircleColor => :int,
    :aacircleRGBA => :int,
    :filledCircleColor => :int,
    :filledCircleRGBA => :int,
    :ellipseColor => :int,
    :ellipseRGBA => :int,
    :aaellipseColor => :int,
    :aaellipseRGBA => :int,
    :filledEllipseColor => :int,
    :filledEllipseRGBA => :int,
    :pieColor => :int,
    :pieRGBA => :int,
    :filledPieColor => :int,
    :filledPieRGBA => :int,
    :trigonColor => :int,
    :trigonRGBA => :int,
    :aatrigonColor => :int,
    :aatrigonRGBA => :int,
    :filledTrigonColor => :int,
    :filledTrigonRGBA => :int,
    :polygonColor => :int,
    :polygonRGBA => :int,
    :aapolygonColor => :int,
    :aapolygonRGBA => :int,
    :filledPolygonColor => :int,
    :filledPolygonRGBA => :int,
    :texturedPolygon => :int,
    :bezierColor => :int,
    :bezierRGBA => :int,
    :gfxPrimitivesSetFont => :void,
    :gfxPrimitivesSetFontRotation => :void,
    :characterColor => :int,
    :characterRGBA => :int,
    :stringColor => :int,
    :stringRGBA => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_gfx_rotozoom_symbols(output_error = false) ⇒ Object

Function



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/sdl2_rotozoom.rb', line 25

def self.setup_gfx_rotozoom_symbols(output_error = false)
  symbols = [
    :rotozoomSurface,
    :rotozoomSurfaceXY,
    :rotozoomSurfaceSize,
    :rotozoomSurfaceSizeXY,
    :zoomSurface,
    :zoomSurfaceSize,
    :shrinkSurface,
    :rotateSurface90Degrees,
  ]
  apis = {
    :rotozoomSurface => :rotozoomSurface,
    :rotozoomSurfaceXY => :rotozoomSurfaceXY,
    :rotozoomSurfaceSize => :rotozoomSurfaceSize,
    :rotozoomSurfaceSizeXY => :rotozoomSurfaceSizeXY,
    :zoomSurface => :zoomSurface,
    :zoomSurfaceSize => :zoomSurfaceSize,
    :shrinkSurface => :shrinkSurface,
    :rotateSurface90Degrees => :rotateSurface90Degrees,
  }
  args = {
    :rotozoomSurface => [:pointer, :double, :double, :int],
    :rotozoomSurfaceXY => [:pointer, :double, :double, :double, :int],
    :rotozoomSurfaceSize => [:int, :int, :double, :double, :pointer, :pointer],
    :rotozoomSurfaceSizeXY => [:int, :int, :double, :double, :double, :pointer, :pointer],
    :zoomSurface => [:pointer, :double, :double, :int],
    :zoomSurfaceSize => [:int, :int, :double, :double, :pointer, :pointer],
    :shrinkSurface => [:pointer, :int, :int],
    :rotateSurface90Degrees => [:pointer, :int],
  }
  retvals = {
    :rotozoomSurface => :pointer,
    :rotozoomSurfaceXY => :pointer,
    :rotozoomSurfaceSize => :void,
    :rotozoomSurfaceSizeXY => :void,
    :zoomSurface => :pointer,
    :zoomSurfaceSize => :void,
    :shrinkSurface => :pointer,
    :rotateSurface90Degrees => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_guid_symbols(output_error = false) ⇒ Object

Function



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/sdl2_guid.rb', line 31

def self.setup_guid_symbols(output_error = false)
  symbols = [
    :SDL_GUIDToString,
    :SDL_GUIDFromString,
  ]
  apis = {
    :SDL_GUIDToString => :GUIDToString,
    :SDL_GUIDFromString => :GUIDFromString,
  }
  args = {
    :SDL_GUIDToString => [GUID.by_value, :pointer, :int],
    :SDL_GUIDFromString => [:pointer],
  }
  retvals = {
    :SDL_GUIDToString => :void,
    :SDL_GUIDFromString => GUID.by_value,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_haptic_symbols(output_error = false) ⇒ Object

Function



162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/sdl2_haptic.rb', line 162

def self.setup_haptic_symbols(output_error = false)
  symbols = [
    :SDL_NumHaptics,
    :SDL_HapticName,
    :SDL_HapticOpen,
    :SDL_HapticOpened,
    :SDL_HapticIndex,
    :SDL_MouseIsHaptic,
    :SDL_HapticOpenFromMouse,
    :SDL_JoystickIsHaptic,
    :SDL_HapticOpenFromJoystick,
    :SDL_HapticClose,
    :SDL_HapticNumEffects,
    :SDL_HapticNumEffectsPlaying,
    :SDL_HapticQuery,
    :SDL_HapticNumAxes,
    :SDL_HapticEffectSupported,
    :SDL_HapticNewEffect,
    :SDL_HapticUpdateEffect,
    :SDL_HapticRunEffect,
    :SDL_HapticStopEffect,
    :SDL_HapticDestroyEffect,
    :SDL_HapticGetEffectStatus,
    :SDL_HapticSetGain,
    :SDL_HapticSetAutocenter,
    :SDL_HapticPause,
    :SDL_HapticUnpause,
    :SDL_HapticStopAll,
    :SDL_HapticRumbleSupported,
    :SDL_HapticRumbleInit,
    :SDL_HapticRumblePlay,
    :SDL_HapticRumbleStop,
  ]
  apis = {
    :SDL_NumHaptics => :NumHaptics,
    :SDL_HapticName => :HapticName,
    :SDL_HapticOpen => :HapticOpen,
    :SDL_HapticOpened => :HapticOpened,
    :SDL_HapticIndex => :HapticIndex,
    :SDL_MouseIsHaptic => :MouseIsHaptic,
    :SDL_HapticOpenFromMouse => :HapticOpenFromMouse,
    :SDL_JoystickIsHaptic => :JoystickIsHaptic,
    :SDL_HapticOpenFromJoystick => :HapticOpenFromJoystick,
    :SDL_HapticClose => :HapticClose,
    :SDL_HapticNumEffects => :HapticNumEffects,
    :SDL_HapticNumEffectsPlaying => :HapticNumEffectsPlaying,
    :SDL_HapticQuery => :HapticQuery,
    :SDL_HapticNumAxes => :HapticNumAxes,
    :SDL_HapticEffectSupported => :HapticEffectSupported,
    :SDL_HapticNewEffect => :HapticNewEffect,
    :SDL_HapticUpdateEffect => :HapticUpdateEffect,
    :SDL_HapticRunEffect => :HapticRunEffect,
    :SDL_HapticStopEffect => :HapticStopEffect,
    :SDL_HapticDestroyEffect => :HapticDestroyEffect,
    :SDL_HapticGetEffectStatus => :HapticGetEffectStatus,
    :SDL_HapticSetGain => :HapticSetGain,
    :SDL_HapticSetAutocenter => :HapticSetAutocenter,
    :SDL_HapticPause => :HapticPause,
    :SDL_HapticUnpause => :HapticUnpause,
    :SDL_HapticStopAll => :HapticStopAll,
    :SDL_HapticRumbleSupported => :HapticRumbleSupported,
    :SDL_HapticRumbleInit => :HapticRumbleInit,
    :SDL_HapticRumblePlay => :HapticRumblePlay,
    :SDL_HapticRumbleStop => :HapticRumbleStop,
  }
  args = {
    :SDL_NumHaptics => [],
    :SDL_HapticName => [:int],
    :SDL_HapticOpen => [:int],
    :SDL_HapticOpened => [:int],
    :SDL_HapticIndex => [:pointer],
    :SDL_MouseIsHaptic => [],
    :SDL_HapticOpenFromMouse => [],
    :SDL_JoystickIsHaptic => [:pointer],
    :SDL_HapticOpenFromJoystick => [:pointer],
    :SDL_HapticClose => [:pointer],
    :SDL_HapticNumEffects => [:pointer],
    :SDL_HapticNumEffectsPlaying => [:pointer],
    :SDL_HapticQuery => [:pointer],
    :SDL_HapticNumAxes => [:pointer],
    :SDL_HapticEffectSupported => [:pointer, :pointer],
    :SDL_HapticNewEffect => [:pointer, :pointer],
    :SDL_HapticUpdateEffect => [:pointer, :int, :pointer],
    :SDL_HapticRunEffect => [:pointer, :int, :uint],
    :SDL_HapticStopEffect => [:pointer, :int],
    :SDL_HapticDestroyEffect => [:pointer, :int],
    :SDL_HapticGetEffectStatus => [:pointer, :int],
    :SDL_HapticSetGain => [:pointer, :int],
    :SDL_HapticSetAutocenter => [:pointer, :int],
    :SDL_HapticPause => [:pointer],
    :SDL_HapticUnpause => [:pointer],
    :SDL_HapticStopAll => [:pointer],
    :SDL_HapticRumbleSupported => [:pointer],
    :SDL_HapticRumbleInit => [:pointer],
    :SDL_HapticRumblePlay => [:pointer, :float, :uint],
    :SDL_HapticRumbleStop => [:pointer],
  }
  retvals = {
    :SDL_NumHaptics => :int,
    :SDL_HapticName => :pointer,
    :SDL_HapticOpen => :pointer,
    :SDL_HapticOpened => :int,
    :SDL_HapticIndex => :int,
    :SDL_MouseIsHaptic => :int,
    :SDL_HapticOpenFromMouse => :pointer,
    :SDL_JoystickIsHaptic => :int,
    :SDL_HapticOpenFromJoystick => :pointer,
    :SDL_HapticClose => :void,
    :SDL_HapticNumEffects => :int,
    :SDL_HapticNumEffectsPlaying => :int,
    :SDL_HapticQuery => :uint,
    :SDL_HapticNumAxes => :int,
    :SDL_HapticEffectSupported => :int,
    :SDL_HapticNewEffect => :int,
    :SDL_HapticUpdateEffect => :int,
    :SDL_HapticRunEffect => :int,
    :SDL_HapticStopEffect => :int,
    :SDL_HapticDestroyEffect => :void,
    :SDL_HapticGetEffectStatus => :int,
    :SDL_HapticSetGain => :int,
    :SDL_HapticSetAutocenter => :int,
    :SDL_HapticPause => :int,
    :SDL_HapticUnpause => :int,
    :SDL_HapticStopAll => :int,
    :SDL_HapticRumbleSupported => :int,
    :SDL_HapticRumbleInit => :int,
    :SDL_HapticRumblePlay => :int,
    :SDL_HapticRumbleStop => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_hidapi_symbols(output_error = false) ⇒ Object

Function



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# File 'lib/sdl2_hidapi.rb', line 44

def self.setup_hidapi_symbols(output_error = false)
  symbols = [
    :SDL_hid_init,
    :SDL_hid_exit,
    :SDL_hid_device_change_count,
    :SDL_hid_enumerate,
    :SDL_hid_free_enumeration,
    :SDL_hid_open,
    :SDL_hid_open_path,
    :SDL_hid_write,
    :SDL_hid_read_timeout,
    :SDL_hid_read,
    :SDL_hid_set_nonblocking,
    :SDL_hid_send_feature_report,
    :SDL_hid_get_feature_report,
    :SDL_hid_close,
    :SDL_hid_get_manufacturer_string,
    :SDL_hid_get_product_string,
    :SDL_hid_get_serial_number_string,
    :SDL_hid_get_indexed_string,
    :SDL_hid_ble_scan,
  ]
  apis = {
    :SDL_hid_init => :hid_init,
    :SDL_hid_exit => :hid_exit,
    :SDL_hid_device_change_count => :hid_device_change_count,
    :SDL_hid_enumerate => :hid_enumerate,
    :SDL_hid_free_enumeration => :hid_free_enumeration,
    :SDL_hid_open => :hid_open,
    :SDL_hid_open_path => :hid_open_path,
    :SDL_hid_write => :hid_write,
    :SDL_hid_read_timeout => :hid_read_timeout,
    :SDL_hid_read => :hid_read,
    :SDL_hid_set_nonblocking => :hid_set_nonblocking,
    :SDL_hid_send_feature_report => :hid_send_feature_report,
    :SDL_hid_get_feature_report => :hid_get_feature_report,
    :SDL_hid_close => :hid_close,
    :SDL_hid_get_manufacturer_string => :hid_get_manufacturer_string,
    :SDL_hid_get_product_string => :hid_get_product_string,
    :SDL_hid_get_serial_number_string => :hid_get_serial_number_string,
    :SDL_hid_get_indexed_string => :hid_get_indexed_string,
    :SDL_hid_ble_scan => :hid_ble_scan,
  }
  args = {
    :SDL_hid_init => [],
    :SDL_hid_exit => [],
    :SDL_hid_device_change_count => [],
    :SDL_hid_enumerate => [:ushort, :ushort],
    :SDL_hid_free_enumeration => [:pointer],
    :SDL_hid_open => [:ushort, :ushort, :pointer],
    :SDL_hid_open_path => [:pointer, :int],
    :SDL_hid_write => [:pointer, :pointer, :ulong],
    :SDL_hid_read_timeout => [:pointer, :pointer, :ulong, :int],
    :SDL_hid_read => [:pointer, :pointer, :ulong],
    :SDL_hid_set_nonblocking => [:pointer, :int],
    :SDL_hid_send_feature_report => [:pointer, :pointer, :ulong],
    :SDL_hid_get_feature_report => [:pointer, :pointer, :ulong],
    :SDL_hid_close => [:pointer],
    :SDL_hid_get_manufacturer_string => [:pointer, :pointer, :ulong],
    :SDL_hid_get_product_string => [:pointer, :pointer, :ulong],
    :SDL_hid_get_serial_number_string => [:pointer, :pointer, :ulong],
    :SDL_hid_get_indexed_string => [:pointer, :int, :pointer, :ulong],
    :SDL_hid_ble_scan => [:int],
  }
  retvals = {
    :SDL_hid_init => :int,
    :SDL_hid_exit => :int,
    :SDL_hid_device_change_count => :uint,
    :SDL_hid_enumerate => :pointer,
    :SDL_hid_free_enumeration => :void,
    :SDL_hid_open => :pointer,
    :SDL_hid_open_path => :pointer,
    :SDL_hid_write => :int,
    :SDL_hid_read_timeout => :int,
    :SDL_hid_read => :int,
    :SDL_hid_set_nonblocking => :int,
    :SDL_hid_send_feature_report => :int,
    :SDL_hid_get_feature_report => :int,
    :SDL_hid_close => :void,
    :SDL_hid_get_manufacturer_string => :int,
    :SDL_hid_get_product_string => :int,
    :SDL_hid_get_serial_number_string => :int,
    :SDL_hid_get_indexed_string => :int,
    :SDL_hid_ble_scan => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_hints_symbols(output_error = false) ⇒ Object

Function



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/sdl2_hints.rb', line 226

def self.setup_hints_symbols(output_error = false)
  symbols = [
    :SDL_SetHintWithPriority,
    :SDL_SetHint,
    :SDL_ResetHint,
    :SDL_ResetHints,
    :SDL_GetHint,
    :SDL_GetHintBoolean,
    :SDL_AddHintCallback,
    :SDL_DelHintCallback,
    :SDL_ClearHints,
  ]
  apis = {
    :SDL_SetHintWithPriority => :SetHintWithPriority,
    :SDL_SetHint => :SetHint,
    :SDL_ResetHint => :ResetHint,
    :SDL_ResetHints => :ResetHints,
    :SDL_GetHint => :GetHint,
    :SDL_GetHintBoolean => :GetHintBoolean,
    :SDL_AddHintCallback => :AddHintCallback,
    :SDL_DelHintCallback => :DelHintCallback,
    :SDL_ClearHints => :ClearHints,
  }
  args = {
    :SDL_SetHintWithPriority => [:pointer, :pointer, :int],
    :SDL_SetHint => [:pointer, :pointer],
    :SDL_ResetHint => [:pointer],
    :SDL_ResetHints => [],
    :SDL_GetHint => [:pointer],
    :SDL_GetHintBoolean => [:pointer, :int],
    :SDL_AddHintCallback => [:pointer, :SDL_HintCallback, :pointer],
    :SDL_DelHintCallback => [:pointer, :SDL_HintCallback, :pointer],
    :SDL_ClearHints => [],
  }
  retvals = {
    :SDL_SetHintWithPriority => :int,
    :SDL_SetHint => :int,
    :SDL_ResetHint => :int,
    :SDL_ResetHints => :void,
    :SDL_GetHint => :pointer,
    :SDL_GetHintBoolean => :int,
    :SDL_AddHintCallback => :void,
    :SDL_DelHintCallback => :void,
    :SDL_ClearHints => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_image_symbols(output_error = false) ⇒ Object

Function



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
# File 'lib/sdl2_image.rb', line 45

def self.setup_image_symbols(output_error = false)
  symbols = [
    :IMG_Linked_Version,
    :IMG_Init,
    :IMG_Quit,
    :IMG_LoadTyped_RW,
    :IMG_Load,
    :IMG_Load_RW,
    :IMG_LoadTexture,
    :IMG_LoadTexture_RW,
    :IMG_LoadTextureTyped_RW,
    :IMG_isAVIF,
    :IMG_isICO,
    :IMG_isCUR,
    :IMG_isBMP,
    :IMG_isGIF,
    :IMG_isJPG,
    :IMG_isJXL,
    :IMG_isLBM,
    :IMG_isPCX,
    :IMG_isPNG,
    :IMG_isPNM,
    :IMG_isSVG,
    :IMG_isQOI,
    :IMG_isTIF,
    :IMG_isXCF,
    :IMG_isXPM,
    :IMG_isXV,
    :IMG_isWEBP,
    :IMG_LoadAVIF_RW,
    :IMG_LoadICO_RW,
    :IMG_LoadCUR_RW,
    :IMG_LoadBMP_RW,
    :IMG_LoadGIF_RW,
    :IMG_LoadJPG_RW,
    :IMG_LoadJXL_RW,
    :IMG_LoadLBM_RW,
    :IMG_LoadPCX_RW,
    :IMG_LoadPNG_RW,
    :IMG_LoadPNM_RW,
    :IMG_LoadSVG_RW,
    :IMG_LoadQOI_RW,
    :IMG_LoadTGA_RW,
    :IMG_LoadTIF_RW,
    :IMG_LoadXCF_RW,
    :IMG_LoadXPM_RW,
    :IMG_LoadXV_RW,
    :IMG_LoadWEBP_RW,
    :IMG_LoadSizedSVG_RW,
    :IMG_ReadXPMFromArray,
    :IMG_ReadXPMFromArrayToRGB888,
    :IMG_SavePNG,
    :IMG_SavePNG_RW,
    :IMG_SaveJPG,
    :IMG_SaveJPG_RW,
    :IMG_LoadAnimation,
    :IMG_LoadAnimation_RW,
    :IMG_LoadAnimationTyped_RW,
    :IMG_FreeAnimation,
    :IMG_LoadGIFAnimation_RW,
    :IMG_LoadWEBPAnimation_RW,
  ]
  apis = {
    :IMG_Linked_Version => :IMG_Linked_Version,
    :IMG_Init => :IMG_Init,
    :IMG_Quit => :IMG_Quit,
    :IMG_LoadTyped_RW => :IMG_LoadTyped_RW,
    :IMG_Load => :IMG_Load,
    :IMG_Load_RW => :IMG_Load_RW,
    :IMG_LoadTexture => :IMG_LoadTexture,
    :IMG_LoadTexture_RW => :IMG_LoadTexture_RW,
    :IMG_LoadTextureTyped_RW => :IMG_LoadTextureTyped_RW,
    :IMG_isAVIF => :IMG_isAVIF,
    :IMG_isICO => :IMG_isICO,
    :IMG_isCUR => :IMG_isCUR,
    :IMG_isBMP => :IMG_isBMP,
    :IMG_isGIF => :IMG_isGIF,
    :IMG_isJPG => :IMG_isJPG,
    :IMG_isJXL => :IMG_isJXL,
    :IMG_isLBM => :IMG_isLBM,
    :IMG_isPCX => :IMG_isPCX,
    :IMG_isPNG => :IMG_isPNG,
    :IMG_isPNM => :IMG_isPNM,
    :IMG_isSVG => :IMG_isSVG,
    :IMG_isQOI => :IMG_isQOI,
    :IMG_isTIF => :IMG_isTIF,
    :IMG_isXCF => :IMG_isXCF,
    :IMG_isXPM => :IMG_isXPM,
    :IMG_isXV => :IMG_isXV,
    :IMG_isWEBP => :IMG_isWEBP,
    :IMG_LoadAVIF_RW => :IMG_LoadAVIF_RW,
    :IMG_LoadICO_RW => :IMG_LoadICO_RW,
    :IMG_LoadCUR_RW => :IMG_LoadCUR_RW,
    :IMG_LoadBMP_RW => :IMG_LoadBMP_RW,
    :IMG_LoadGIF_RW => :IMG_LoadGIF_RW,
    :IMG_LoadJPG_RW => :IMG_LoadJPG_RW,
    :IMG_LoadJXL_RW => :IMG_LoadJXL_RW,
    :IMG_LoadLBM_RW => :IMG_LoadLBM_RW,
    :IMG_LoadPCX_RW => :IMG_LoadPCX_RW,
    :IMG_LoadPNG_RW => :IMG_LoadPNG_RW,
    :IMG_LoadPNM_RW => :IMG_LoadPNM_RW,
    :IMG_LoadSVG_RW => :IMG_LoadSVG_RW,
    :IMG_LoadQOI_RW => :IMG_LoadQOI_RW,
    :IMG_LoadTGA_RW => :IMG_LoadTGA_RW,
    :IMG_LoadTIF_RW => :IMG_LoadTIF_RW,
    :IMG_LoadXCF_RW => :IMG_LoadXCF_RW,
    :IMG_LoadXPM_RW => :IMG_LoadXPM_RW,
    :IMG_LoadXV_RW => :IMG_LoadXV_RW,
    :IMG_LoadWEBP_RW => :IMG_LoadWEBP_RW,
    :IMG_LoadSizedSVG_RW => :IMG_LoadSizedSVG_RW,
    :IMG_ReadXPMFromArray => :IMG_ReadXPMFromArray,
    :IMG_ReadXPMFromArrayToRGB888 => :IMG_ReadXPMFromArrayToRGB888,
    :IMG_SavePNG => :IMG_SavePNG,
    :IMG_SavePNG_RW => :IMG_SavePNG_RW,
    :IMG_SaveJPG => :IMG_SaveJPG,
    :IMG_SaveJPG_RW => :IMG_SaveJPG_RW,
    :IMG_LoadAnimation => :IMG_LoadAnimation,
    :IMG_LoadAnimation_RW => :IMG_LoadAnimation_RW,
    :IMG_LoadAnimationTyped_RW => :IMG_LoadAnimationTyped_RW,
    :IMG_FreeAnimation => :IMG_FreeAnimation,
    :IMG_LoadGIFAnimation_RW => :IMG_LoadGIFAnimation_RW,
    :IMG_LoadWEBPAnimation_RW => :IMG_LoadWEBPAnimation_RW,
  }
  args = {
    :IMG_Linked_Version => [],
    :IMG_Init => [:int],
    :IMG_Quit => [],
    :IMG_LoadTyped_RW => [:pointer, :int, :pointer],
    :IMG_Load => [:pointer],
    :IMG_Load_RW => [:pointer, :int],
    :IMG_LoadTexture => [:pointer, :pointer],
    :IMG_LoadTexture_RW => [:pointer, :pointer, :int],
    :IMG_LoadTextureTyped_RW => [:pointer, :pointer, :int, :pointer],
    :IMG_isAVIF => [:pointer],
    :IMG_isICO => [:pointer],
    :IMG_isCUR => [:pointer],
    :IMG_isBMP => [:pointer],
    :IMG_isGIF => [:pointer],
    :IMG_isJPG => [:pointer],
    :IMG_isJXL => [:pointer],
    :IMG_isLBM => [:pointer],
    :IMG_isPCX => [:pointer],
    :IMG_isPNG => [:pointer],
    :IMG_isPNM => [:pointer],
    :IMG_isSVG => [:pointer],
    :IMG_isQOI => [:pointer],
    :IMG_isTIF => [:pointer],
    :IMG_isXCF => [:pointer],
    :IMG_isXPM => [:pointer],
    :IMG_isXV => [:pointer],
    :IMG_isWEBP => [:pointer],
    :IMG_LoadAVIF_RW => [:pointer],
    :IMG_LoadICO_RW => [:pointer],
    :IMG_LoadCUR_RW => [:pointer],
    :IMG_LoadBMP_RW => [:pointer],
    :IMG_LoadGIF_RW => [:pointer],
    :IMG_LoadJPG_RW => [:pointer],
    :IMG_LoadJXL_RW => [:pointer],
    :IMG_LoadLBM_RW => [:pointer],
    :IMG_LoadPCX_RW => [:pointer],
    :IMG_LoadPNG_RW => [:pointer],
    :IMG_LoadPNM_RW => [:pointer],
    :IMG_LoadSVG_RW => [:pointer],
    :IMG_LoadQOI_RW => [:pointer],
    :IMG_LoadTGA_RW => [:pointer],
    :IMG_LoadTIF_RW => [:pointer],
    :IMG_LoadXCF_RW => [:pointer],
    :IMG_LoadXPM_RW => [:pointer],
    :IMG_LoadXV_RW => [:pointer],
    :IMG_LoadWEBP_RW => [:pointer],
    :IMG_LoadSizedSVG_RW => [:pointer, :int, :int],
    :IMG_ReadXPMFromArray => [:pointer],
    :IMG_ReadXPMFromArrayToRGB888 => [:pointer],
    :IMG_SavePNG => [:pointer, :pointer],
    :IMG_SavePNG_RW => [:pointer, :pointer, :int],
    :IMG_SaveJPG => [:pointer, :pointer, :int],
    :IMG_SaveJPG_RW => [:pointer, :pointer, :int, :int],
    :IMG_LoadAnimation => [:pointer],
    :IMG_LoadAnimation_RW => [:pointer, :int],
    :IMG_LoadAnimationTyped_RW => [:pointer, :int, :pointer],
    :IMG_FreeAnimation => [:pointer],
    :IMG_LoadGIFAnimation_RW => [:pointer],
    :IMG_LoadWEBPAnimation_RW => [:pointer],
  }
  retvals = {
    :IMG_Linked_Version => :pointer,
    :IMG_Init => :int,
    :IMG_Quit => :void,
    :IMG_LoadTyped_RW => :pointer,
    :IMG_Load => :pointer,
    :IMG_Load_RW => :pointer,
    :IMG_LoadTexture => :pointer,
    :IMG_LoadTexture_RW => :pointer,
    :IMG_LoadTextureTyped_RW => :pointer,
    :IMG_isAVIF => :int,
    :IMG_isICO => :int,
    :IMG_isCUR => :int,
    :IMG_isBMP => :int,
    :IMG_isGIF => :int,
    :IMG_isJPG => :int,
    :IMG_isJXL => :int,
    :IMG_isLBM => :int,
    :IMG_isPCX => :int,
    :IMG_isPNG => :int,
    :IMG_isPNM => :int,
    :IMG_isSVG => :int,
    :IMG_isQOI => :int,
    :IMG_isTIF => :int,
    :IMG_isXCF => :int,
    :IMG_isXPM => :int,
    :IMG_isXV => :int,
    :IMG_isWEBP => :int,
    :IMG_LoadAVIF_RW => :pointer,
    :IMG_LoadICO_RW => :pointer,
    :IMG_LoadCUR_RW => :pointer,
    :IMG_LoadBMP_RW => :pointer,
    :IMG_LoadGIF_RW => :pointer,
    :IMG_LoadJPG_RW => :pointer,
    :IMG_LoadJXL_RW => :pointer,
    :IMG_LoadLBM_RW => :pointer,
    :IMG_LoadPCX_RW => :pointer,
    :IMG_LoadPNG_RW => :pointer,
    :IMG_LoadPNM_RW => :pointer,
    :IMG_LoadSVG_RW => :pointer,
    :IMG_LoadQOI_RW => :pointer,
    :IMG_LoadTGA_RW => :pointer,
    :IMG_LoadTIF_RW => :pointer,
    :IMG_LoadXCF_RW => :pointer,
    :IMG_LoadXPM_RW => :pointer,
    :IMG_LoadXV_RW => :pointer,
    :IMG_LoadWEBP_RW => :pointer,
    :IMG_LoadSizedSVG_RW => :pointer,
    :IMG_ReadXPMFromArray => :pointer,
    :IMG_ReadXPMFromArrayToRGB888 => :pointer,
    :IMG_SavePNG => :int,
    :IMG_SavePNG_RW => :int,
    :IMG_SaveJPG => :int,
    :IMG_SaveJPG_RW => :int,
    :IMG_LoadAnimation => :pointer,
    :IMG_LoadAnimation_RW => :pointer,
    :IMG_LoadAnimationTyped_RW => :pointer,
    :IMG_FreeAnimation => :void,
    :IMG_LoadGIFAnimation_RW => :pointer,
    :IMG_LoadWEBPAnimation_RW => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_joystick_symbols(output_error = false) ⇒ Object

Function



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
# File 'lib/sdl2_joystick.rb', line 85

def self.setup_joystick_symbols(output_error = false)
  symbols = [
    :SDL_LockJoysticks,
    :SDL_UnlockJoysticks,
    :SDL_NumJoysticks,
    :SDL_JoystickNameForIndex,
    :SDL_JoystickPathForIndex,
    :SDL_JoystickGetDevicePlayerIndex,
    :SDL_JoystickGetDeviceGUID,
    :SDL_JoystickGetDeviceVendor,
    :SDL_JoystickGetDeviceProduct,
    :SDL_JoystickGetDeviceProductVersion,
    :SDL_JoystickGetDeviceType,
    :SDL_JoystickGetDeviceInstanceID,
    :SDL_JoystickOpen,
    :SDL_JoystickFromInstanceID,
    :SDL_JoystickFromPlayerIndex,
    :SDL_JoystickAttachVirtual,
    :SDL_JoystickAttachVirtualEx,
    :SDL_JoystickDetachVirtual,
    :SDL_JoystickIsVirtual,
    :SDL_JoystickSetVirtualAxis,
    :SDL_JoystickSetVirtualButton,
    :SDL_JoystickSetVirtualHat,
    :SDL_JoystickName,
    :SDL_JoystickPath,
    :SDL_JoystickGetPlayerIndex,
    :SDL_JoystickSetPlayerIndex,
    :SDL_JoystickGetGUID,
    :SDL_JoystickGetVendor,
    :SDL_JoystickGetProduct,
    :SDL_JoystickGetProductVersion,
    :SDL_JoystickGetFirmwareVersion,
    :SDL_JoystickGetSerial,
    :SDL_JoystickGetType,
    :SDL_JoystickGetGUIDString,
    :SDL_JoystickGetGUIDFromString,
    :SDL_GetJoystickGUIDInfo,
    :SDL_JoystickGetAttached,
    :SDL_JoystickInstanceID,
    :SDL_JoystickNumAxes,
    :SDL_JoystickNumBalls,
    :SDL_JoystickNumHats,
    :SDL_JoystickNumButtons,
    :SDL_JoystickUpdate,
    :SDL_JoystickEventState,
    :SDL_JoystickGetAxis,
    :SDL_JoystickGetAxisInitialState,
    :SDL_JoystickGetHat,
    :SDL_JoystickGetBall,
    :SDL_JoystickGetButton,
    :SDL_JoystickRumble,
    :SDL_JoystickRumbleTriggers,
    :SDL_JoystickHasLED,
    :SDL_JoystickHasRumble,
    :SDL_JoystickHasRumbleTriggers,
    :SDL_JoystickSetLED,
    :SDL_JoystickSendEffect,
    :SDL_JoystickClose,
    :SDL_JoystickCurrentPowerLevel,
  ]
  apis = {
    :SDL_LockJoysticks => :LockJoysticks,
    :SDL_UnlockJoysticks => :UnlockJoysticks,
    :SDL_NumJoysticks => :NumJoysticks,
    :SDL_JoystickNameForIndex => :JoystickNameForIndex,
    :SDL_JoystickPathForIndex => :JoystickPathForIndex,
    :SDL_JoystickGetDevicePlayerIndex => :JoystickGetDevicePlayerIndex,
    :SDL_JoystickGetDeviceGUID => :JoystickGetDeviceGUID,
    :SDL_JoystickGetDeviceVendor => :JoystickGetDeviceVendor,
    :SDL_JoystickGetDeviceProduct => :JoystickGetDeviceProduct,
    :SDL_JoystickGetDeviceProductVersion => :JoystickGetDeviceProductVersion,
    :SDL_JoystickGetDeviceType => :JoystickGetDeviceType,
    :SDL_JoystickGetDeviceInstanceID => :JoystickGetDeviceInstanceID,
    :SDL_JoystickOpen => :JoystickOpen,
    :SDL_JoystickFromInstanceID => :JoystickFromInstanceID,
    :SDL_JoystickFromPlayerIndex => :JoystickFromPlayerIndex,
    :SDL_JoystickAttachVirtual => :JoystickAttachVirtual,
    :SDL_JoystickAttachVirtualEx => :JoystickAttachVirtualEx,
    :SDL_JoystickDetachVirtual => :JoystickDetachVirtual,
    :SDL_JoystickIsVirtual => :JoystickIsVirtual,
    :SDL_JoystickSetVirtualAxis => :JoystickSetVirtualAxis,
    :SDL_JoystickSetVirtualButton => :JoystickSetVirtualButton,
    :SDL_JoystickSetVirtualHat => :JoystickSetVirtualHat,
    :SDL_JoystickName => :JoystickName,
    :SDL_JoystickPath => :JoystickPath,
    :SDL_JoystickGetPlayerIndex => :JoystickGetPlayerIndex,
    :SDL_JoystickSetPlayerIndex => :JoystickSetPlayerIndex,
    :SDL_JoystickGetGUID => :JoystickGetGUID,
    :SDL_JoystickGetVendor => :JoystickGetVendor,
    :SDL_JoystickGetProduct => :JoystickGetProduct,
    :SDL_JoystickGetProductVersion => :JoystickGetProductVersion,
    :SDL_JoystickGetFirmwareVersion => :JoystickGetFirmwareVersion,
    :SDL_JoystickGetSerial => :JoystickGetSerial,
    :SDL_JoystickGetType => :JoystickGetType,
    :SDL_JoystickGetGUIDString => :JoystickGetGUIDString,
    :SDL_JoystickGetGUIDFromString => :JoystickGetGUIDFromString,
    :SDL_GetJoystickGUIDInfo => :GetJoystickGUIDInfo,
    :SDL_JoystickGetAttached => :JoystickGetAttached,
    :SDL_JoystickInstanceID => :JoystickInstanceID,
    :SDL_JoystickNumAxes => :JoystickNumAxes,
    :SDL_JoystickNumBalls => :JoystickNumBalls,
    :SDL_JoystickNumHats => :JoystickNumHats,
    :SDL_JoystickNumButtons => :JoystickNumButtons,
    :SDL_JoystickUpdate => :JoystickUpdate,
    :SDL_JoystickEventState => :JoystickEventState,
    :SDL_JoystickGetAxis => :JoystickGetAxis,
    :SDL_JoystickGetAxisInitialState => :JoystickGetAxisInitialState,
    :SDL_JoystickGetHat => :JoystickGetHat,
    :SDL_JoystickGetBall => :JoystickGetBall,
    :SDL_JoystickGetButton => :JoystickGetButton,
    :SDL_JoystickRumble => :JoystickRumble,
    :SDL_JoystickRumbleTriggers => :JoystickRumbleTriggers,
    :SDL_JoystickHasLED => :JoystickHasLED,
    :SDL_JoystickHasRumble => :JoystickHasRumble,
    :SDL_JoystickHasRumbleTriggers => :JoystickHasRumbleTriggers,
    :SDL_JoystickSetLED => :JoystickSetLED,
    :SDL_JoystickSendEffect => :JoystickSendEffect,
    :SDL_JoystickClose => :JoystickClose,
    :SDL_JoystickCurrentPowerLevel => :JoystickCurrentPowerLevel,
  }
  args = {
    :SDL_LockJoysticks => [],
    :SDL_UnlockJoysticks => [],
    :SDL_NumJoysticks => [],
    :SDL_JoystickNameForIndex => [:int],
    :SDL_JoystickPathForIndex => [:int],
    :SDL_JoystickGetDevicePlayerIndex => [:int],
    :SDL_JoystickGetDeviceGUID => [:int],
    :SDL_JoystickGetDeviceVendor => [:int],
    :SDL_JoystickGetDeviceProduct => [:int],
    :SDL_JoystickGetDeviceProductVersion => [:int],
    :SDL_JoystickGetDeviceType => [:int],
    :SDL_JoystickGetDeviceInstanceID => [:int],
    :SDL_JoystickOpen => [:int],
    :SDL_JoystickFromInstanceID => [:int],
    :SDL_JoystickFromPlayerIndex => [:int],
    :SDL_JoystickAttachVirtual => [:int, :int, :int, :int],
    :SDL_JoystickAttachVirtualEx => [:pointer],
    :SDL_JoystickDetachVirtual => [:int],
    :SDL_JoystickIsVirtual => [:int],
    :SDL_JoystickSetVirtualAxis => [:pointer, :int, :short],
    :SDL_JoystickSetVirtualButton => [:pointer, :int, :uchar],
    :SDL_JoystickSetVirtualHat => [:pointer, :int, :uchar],
    :SDL_JoystickName => [:pointer],
    :SDL_JoystickPath => [:pointer],
    :SDL_JoystickGetPlayerIndex => [:pointer],
    :SDL_JoystickSetPlayerIndex => [:pointer, :int],
    :SDL_JoystickGetGUID => [:pointer],
    :SDL_JoystickGetVendor => [:pointer],
    :SDL_JoystickGetProduct => [:pointer],
    :SDL_JoystickGetProductVersion => [:pointer],
    :SDL_JoystickGetFirmwareVersion => [:pointer],
    :SDL_JoystickGetSerial => [:pointer],
    :SDL_JoystickGetType => [:pointer],
    :SDL_JoystickGetGUIDString => [JoystickGUID.by_value, :pointer, :int],
    :SDL_JoystickGetGUIDFromString => [:pointer],
    :SDL_GetJoystickGUIDInfo => [JoystickGUID.by_value, :pointer, :pointer, :pointer, :pointer],
    :SDL_JoystickGetAttached => [:pointer],
    :SDL_JoystickInstanceID => [:pointer],
    :SDL_JoystickNumAxes => [:pointer],
    :SDL_JoystickNumBalls => [:pointer],
    :SDL_JoystickNumHats => [:pointer],
    :SDL_JoystickNumButtons => [:pointer],
    :SDL_JoystickUpdate => [],
    :SDL_JoystickEventState => [:int],
    :SDL_JoystickGetAxis => [:pointer, :int],
    :SDL_JoystickGetAxisInitialState => [:pointer, :int, :pointer],
    :SDL_JoystickGetHat => [:pointer, :int],
    :SDL_JoystickGetBall => [:pointer, :int, :pointer, :pointer],
    :SDL_JoystickGetButton => [:pointer, :int],
    :SDL_JoystickRumble => [:pointer, :ushort, :ushort, :uint],
    :SDL_JoystickRumbleTriggers => [:pointer, :ushort, :ushort, :uint],
    :SDL_JoystickHasLED => [:pointer],
    :SDL_JoystickHasRumble => [:pointer],
    :SDL_JoystickHasRumbleTriggers => [:pointer],
    :SDL_JoystickSetLED => [:pointer, :uchar, :uchar, :uchar],
    :SDL_JoystickSendEffect => [:pointer, :pointer, :int],
    :SDL_JoystickClose => [:pointer],
    :SDL_JoystickCurrentPowerLevel => [:pointer],
  }
  retvals = {
    :SDL_LockJoysticks => :void,
    :SDL_UnlockJoysticks => :void,
    :SDL_NumJoysticks => :int,
    :SDL_JoystickNameForIndex => :pointer,
    :SDL_JoystickPathForIndex => :pointer,
    :SDL_JoystickGetDevicePlayerIndex => :int,
    :SDL_JoystickGetDeviceGUID => JoystickGUID.by_value,
    :SDL_JoystickGetDeviceVendor => :ushort,
    :SDL_JoystickGetDeviceProduct => :ushort,
    :SDL_JoystickGetDeviceProductVersion => :ushort,
    :SDL_JoystickGetDeviceType => :int,
    :SDL_JoystickGetDeviceInstanceID => :int,
    :SDL_JoystickOpen => :pointer,
    :SDL_JoystickFromInstanceID => :pointer,
    :SDL_JoystickFromPlayerIndex => :pointer,
    :SDL_JoystickAttachVirtual => :int,
    :SDL_JoystickAttachVirtualEx => :int,
    :SDL_JoystickDetachVirtual => :int,
    :SDL_JoystickIsVirtual => :int,
    :SDL_JoystickSetVirtualAxis => :int,
    :SDL_JoystickSetVirtualButton => :int,
    :SDL_JoystickSetVirtualHat => :int,
    :SDL_JoystickName => :pointer,
    :SDL_JoystickPath => :pointer,
    :SDL_JoystickGetPlayerIndex => :int,
    :SDL_JoystickSetPlayerIndex => :void,
    :SDL_JoystickGetGUID => JoystickGUID.by_value,
    :SDL_JoystickGetVendor => :ushort,
    :SDL_JoystickGetProduct => :ushort,
    :SDL_JoystickGetProductVersion => :ushort,
    :SDL_JoystickGetFirmwareVersion => :ushort,
    :SDL_JoystickGetSerial => :pointer,
    :SDL_JoystickGetType => :int,
    :SDL_JoystickGetGUIDString => :void,
    :SDL_JoystickGetGUIDFromString => JoystickGUID.by_value,
    :SDL_GetJoystickGUIDInfo => :void,
    :SDL_JoystickGetAttached => :int,
    :SDL_JoystickInstanceID => :int,
    :SDL_JoystickNumAxes => :int,
    :SDL_JoystickNumBalls => :int,
    :SDL_JoystickNumHats => :int,
    :SDL_JoystickNumButtons => :int,
    :SDL_JoystickUpdate => :void,
    :SDL_JoystickEventState => :int,
    :SDL_JoystickGetAxis => :short,
    :SDL_JoystickGetAxisInitialState => :int,
    :SDL_JoystickGetHat => :uchar,
    :SDL_JoystickGetBall => :int,
    :SDL_JoystickGetButton => :uchar,
    :SDL_JoystickRumble => :int,
    :SDL_JoystickRumbleTriggers => :int,
    :SDL_JoystickHasLED => :int,
    :SDL_JoystickHasRumble => :int,
    :SDL_JoystickHasRumbleTriggers => :int,
    :SDL_JoystickSetLED => :int,
    :SDL_JoystickSendEffect => :int,
    :SDL_JoystickClose => :void,
    :SDL_JoystickCurrentPowerLevel => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_keyboard_symbols(output_error = false) ⇒ Object

Function



34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# File 'lib/sdl2_keyboard.rb', line 34

def self.setup_keyboard_symbols(output_error = false)
  symbols = [
    :SDL_GetKeyboardFocus,
    :SDL_GetKeyboardState,
    :SDL_ResetKeyboard,
    :SDL_GetModState,
    :SDL_SetModState,
    :SDL_GetKeyFromScancode,
    :SDL_GetScancodeFromKey,
    :SDL_GetScancodeName,
    :SDL_GetScancodeFromName,
    :SDL_GetKeyName,
    :SDL_GetKeyFromName,
    :SDL_StartTextInput,
    :SDL_IsTextInputActive,
    :SDL_StopTextInput,
    :SDL_ClearComposition,
    :SDL_IsTextInputShown,
    :SDL_SetTextInputRect,
    :SDL_HasScreenKeyboardSupport,
    :SDL_IsScreenKeyboardShown,
  ]
  apis = {
    :SDL_GetKeyboardFocus => :GetKeyboardFocus,
    :SDL_GetKeyboardState => :GetKeyboardState,
    :SDL_ResetKeyboard => :ResetKeyboard,
    :SDL_GetModState => :GetModState,
    :SDL_SetModState => :SetModState,
    :SDL_GetKeyFromScancode => :GetKeyFromScancode,
    :SDL_GetScancodeFromKey => :GetScancodeFromKey,
    :SDL_GetScancodeName => :GetScancodeName,
    :SDL_GetScancodeFromName => :GetScancodeFromName,
    :SDL_GetKeyName => :GetKeyName,
    :SDL_GetKeyFromName => :GetKeyFromName,
    :SDL_StartTextInput => :StartTextInput,
    :SDL_IsTextInputActive => :IsTextInputActive,
    :SDL_StopTextInput => :StopTextInput,
    :SDL_ClearComposition => :ClearComposition,
    :SDL_IsTextInputShown => :IsTextInputShown,
    :SDL_SetTextInputRect => :SetTextInputRect,
    :SDL_HasScreenKeyboardSupport => :HasScreenKeyboardSupport,
    :SDL_IsScreenKeyboardShown => :IsScreenKeyboardShown,
  }
  args = {
    :SDL_GetKeyboardFocus => [],
    :SDL_GetKeyboardState => [:pointer],
    :SDL_ResetKeyboard => [],
    :SDL_GetModState => [],
    :SDL_SetModState => [:int],
    :SDL_GetKeyFromScancode => [:int],
    :SDL_GetScancodeFromKey => [:int],
    :SDL_GetScancodeName => [:int],
    :SDL_GetScancodeFromName => [:pointer],
    :SDL_GetKeyName => [:int],
    :SDL_GetKeyFromName => [:pointer],
    :SDL_StartTextInput => [],
    :SDL_IsTextInputActive => [],
    :SDL_StopTextInput => [],
    :SDL_ClearComposition => [],
    :SDL_IsTextInputShown => [],
    :SDL_SetTextInputRect => [:pointer],
    :SDL_HasScreenKeyboardSupport => [],
    :SDL_IsScreenKeyboardShown => [:pointer],
  }
  retvals = {
    :SDL_GetKeyboardFocus => :pointer,
    :SDL_GetKeyboardState => :pointer,
    :SDL_ResetKeyboard => :void,
    :SDL_GetModState => :int,
    :SDL_SetModState => :void,
    :SDL_GetKeyFromScancode => :int,
    :SDL_GetScancodeFromKey => :int,
    :SDL_GetScancodeName => :pointer,
    :SDL_GetScancodeFromName => :int,
    :SDL_GetKeyName => :pointer,
    :SDL_GetKeyFromName => :int,
    :SDL_StartTextInput => :void,
    :SDL_IsTextInputActive => :int,
    :SDL_StopTextInput => :void,
    :SDL_ClearComposition => :void,
    :SDL_IsTextInputShown => :int,
    :SDL_SetTextInputRect => :void,
    :SDL_HasScreenKeyboardSupport => :int,
    :SDL_IsScreenKeyboardShown => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_keycode_symbols(output_error = false) ⇒ Object

Function



290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/sdl2_keycode.rb', line 290

def self.setup_keycode_symbols(output_error = false)
  symbols = [
  ]
  apis = {
  }
  args = {
  }
  retvals = {
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_log_symbols(output_error = false) ⇒ Object

Function



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/sdl2_log.rb', line 56

def self.setup_log_symbols(output_error = false)
  symbols = [
    :SDL_LogSetAllPriority,
    :SDL_LogSetPriority,
    :SDL_LogGetPriority,
    :SDL_LogResetPriorities,
    :SDL_Log,
    :SDL_LogVerbose,
    :SDL_LogDebug,
    :SDL_LogInfo,
    :SDL_LogWarn,
    :SDL_LogError,
    :SDL_LogCritical,
    :SDL_LogMessage,
    :SDL_LogGetOutputFunction,
    :SDL_LogSetOutputFunction,
  ]
  apis = {
    :SDL_LogSetAllPriority => :LogSetAllPriority,
    :SDL_LogSetPriority => :LogSetPriority,
    :SDL_LogGetPriority => :LogGetPriority,
    :SDL_LogResetPriorities => :LogResetPriorities,
    :SDL_Log => :Log,
    :SDL_LogVerbose => :LogVerbose,
    :SDL_LogDebug => :LogDebug,
    :SDL_LogInfo => :LogInfo,
    :SDL_LogWarn => :LogWarn,
    :SDL_LogError => :LogError,
    :SDL_LogCritical => :LogCritical,
    :SDL_LogMessage => :LogMessage,
    :SDL_LogGetOutputFunction => :LogGetOutputFunction,
    :SDL_LogSetOutputFunction => :LogSetOutputFunction,
  }
  args = {
    :SDL_LogSetAllPriority => [:int],
    :SDL_LogSetPriority => [:int, :int],
    :SDL_LogGetPriority => [:int],
    :SDL_LogResetPriorities => [],
    :SDL_Log => [:pointer],
    :SDL_LogVerbose => [:int, :pointer],
    :SDL_LogDebug => [:int, :pointer],
    :SDL_LogInfo => [:int, :pointer],
    :SDL_LogWarn => [:int, :pointer],
    :SDL_LogError => [:int, :pointer],
    :SDL_LogCritical => [:int, :pointer],
    :SDL_LogMessage => [:int, :int, :pointer],
    :SDL_LogGetOutputFunction => [:pointer, :pointer],
    :SDL_LogSetOutputFunction => [:SDL_LogOutputFunction, :pointer],
  }
  retvals = {
    :SDL_LogSetAllPriority => :void,
    :SDL_LogSetPriority => :void,
    :SDL_LogGetPriority => :int,
    :SDL_LogResetPriorities => :void,
    :SDL_Log => :void,
    :SDL_LogVerbose => :void,
    :SDL_LogDebug => :void,
    :SDL_LogInfo => :void,
    :SDL_LogWarn => :void,
    :SDL_LogError => :void,
    :SDL_LogCritical => :void,
    :SDL_LogMessage => :void,
    :SDL_LogGetOutputFunction => :void,
    :SDL_LogSetOutputFunction => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_main_symbols(output_error = false) ⇒ Object

Function



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/sdl2_main.rb', line 35

def self.setup_main_symbols(output_error = false)
  symbols = [
    :SDL_Init,
    :SDL_InitSubSystem,
    :SDL_QuitSubSystem,
    :SDL_WasInit,
    :SDL_Quit,
  ]
  apis = {
    :SDL_Init => :Init,
    :SDL_InitSubSystem => :InitSubSystem,
    :SDL_QuitSubSystem => :QuitSubSystem,
    :SDL_WasInit => :WasInit,
    :SDL_Quit => :Quit,
  }
  args = {
    :SDL_Init => [:uint],
    :SDL_InitSubSystem => [:uint],
    :SDL_QuitSubSystem => [:uint],
    :SDL_WasInit => [:uint],
    :SDL_Quit => [],
  }
  retvals = {
    :SDL_Init => :int,
    :SDL_InitSubSystem => :int,
    :SDL_QuitSubSystem => :void,
    :SDL_WasInit => :uint,
    :SDL_Quit => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_messagebox_symbols(output_error = false) ⇒ Object

Function



75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/sdl2_messagebox.rb', line 75

def self.setup_messagebox_symbols(output_error = false)
  symbols = [
    :SDL_ShowMessageBox,
    :SDL_ShowSimpleMessageBox,
  ]
  apis = {
    :SDL_ShowMessageBox => :ShowMessageBox,
    :SDL_ShowSimpleMessageBox => :ShowSimpleMessageBox,
  }
  args = {
    :SDL_ShowMessageBox => [:pointer, :pointer],
    :SDL_ShowSimpleMessageBox => [:uint, :pointer, :pointer, :pointer],
  }
  retvals = {
    :SDL_ShowMessageBox => :int,
    :SDL_ShowSimpleMessageBox => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_misc_symbols(output_error = false) ⇒ Object

Function



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/sdl2_misc.rb', line 25

def self.setup_misc_symbols(output_error = false)
  symbols = [
    :SDL_OpenURL,
  ]
  apis = {
    :SDL_OpenURL => :OpenURL,
  }
  args = {
    :SDL_OpenURL => [:pointer],
  }
  retvals = {
    :SDL_OpenURL => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_mixer_symbols(output_error = false) ⇒ Object

Function



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
# File 'lib/sdl2_mixer.rb', line 70

def self.setup_mixer_symbols(output_error = false)
  symbols = [
    :Mix_Linked_Version,
    :Mix_Init,
    :Mix_Quit,
    :Mix_OpenAudio,
    :Mix_OpenAudioDevice,
    :Mix_PauseAudio,
    :Mix_QuerySpec,
    :Mix_AllocateChannels,
    :Mix_LoadWAV_RW,
    :Mix_LoadWAV,
    :Mix_LoadMUS,
    :Mix_LoadMUS_RW,
    :Mix_LoadMUSType_RW,
    :Mix_QuickLoad_WAV,
    :Mix_QuickLoad_RAW,
    :Mix_FreeChunk,
    :Mix_FreeMusic,
    :Mix_GetNumChunkDecoders,
    :Mix_GetChunkDecoder,
    :Mix_HasChunkDecoder,
    :Mix_GetNumMusicDecoders,
    :Mix_GetMusicDecoder,
    :Mix_HasMusicDecoder,
    :Mix_GetMusicType,
    :Mix_GetMusicTitle,
    :Mix_GetMusicTitleTag,
    :Mix_GetMusicArtistTag,
    :Mix_GetMusicAlbumTag,
    :Mix_GetMusicCopyrightTag,
    :Mix_SetPostMix,
    :Mix_HookMusic,
    :Mix_HookMusicFinished,
    :Mix_GetMusicHookData,
    :Mix_ChannelFinished,
    :Mix_RegisterEffect,
    :Mix_UnregisterEffect,
    :Mix_UnregisterAllEffects,
    :Mix_SetPanning,
    :Mix_SetPosition,
    :Mix_SetDistance,
    :Mix_SetReverseStereo,
    :Mix_ReserveChannels,
    :Mix_GroupChannel,
    :Mix_GroupChannels,
    :Mix_GroupAvailable,
    :Mix_GroupCount,
    :Mix_GroupOldest,
    :Mix_GroupNewer,
    :Mix_PlayChannel,
    :Mix_PlayChannelTimed,
    :Mix_PlayMusic,
    :Mix_FadeInMusic,
    :Mix_FadeInMusicPos,
    :Mix_FadeInChannel,
    :Mix_FadeInChannelTimed,
    :Mix_Volume,
    :Mix_VolumeChunk,
    :Mix_VolumeMusic,
    :Mix_GetMusicVolume,
    :Mix_MasterVolume,
    :Mix_HaltChannel,
    :Mix_HaltGroup,
    :Mix_HaltMusic,
    :Mix_ExpireChannel,
    :Mix_FadeOutChannel,
    :Mix_FadeOutGroup,
    :Mix_FadeOutMusic,
    :Mix_FadingMusic,
    :Mix_FadingChannel,
    :Mix_Pause,
    :Mix_Resume,
    :Mix_Paused,
    :Mix_PauseMusic,
    :Mix_ResumeMusic,
    :Mix_RewindMusic,
    :Mix_PausedMusic,
    :Mix_ModMusicJumpToOrder,
    :Mix_StartTrack,
    :Mix_GetNumTracks,
    :Mix_SetMusicPosition,
    :Mix_GetMusicPosition,
    :Mix_MusicDuration,
    :Mix_GetMusicLoopStartTime,
    :Mix_GetMusicLoopEndTime,
    :Mix_GetMusicLoopLengthTime,
    :Mix_Playing,
    :Mix_PlayingMusic,
    :Mix_SetMusicCMD,
    :Mix_SetSynchroValue,
    :Mix_GetSynchroValue,
    :Mix_SetSoundFonts,
    :Mix_GetSoundFonts,
    :Mix_EachSoundFont,
    :Mix_SetTimidityCfg,
    :Mix_GetTimidityCfg,
    :Mix_GetChunk,
    :Mix_CloseAudio,
  ]
  apis = {
    :Mix_Linked_Version => :Mix_Linked_Version,
    :Mix_Init => :Mix_Init,
    :Mix_Quit => :Mix_Quit,
    :Mix_OpenAudio => :Mix_OpenAudio,
    :Mix_OpenAudioDevice => :Mix_OpenAudioDevice,
    :Mix_PauseAudio => :Mix_PauseAudio,
    :Mix_QuerySpec => :Mix_QuerySpec,
    :Mix_AllocateChannels => :Mix_AllocateChannels,
    :Mix_LoadWAV_RW => :Mix_LoadWAV_RW,
    :Mix_LoadWAV => :Mix_LoadWAV,
    :Mix_LoadMUS => :Mix_LoadMUS,
    :Mix_LoadMUS_RW => :Mix_LoadMUS_RW,
    :Mix_LoadMUSType_RW => :Mix_LoadMUSType_RW,
    :Mix_QuickLoad_WAV => :Mix_QuickLoad_WAV,
    :Mix_QuickLoad_RAW => :Mix_QuickLoad_RAW,
    :Mix_FreeChunk => :Mix_FreeChunk,
    :Mix_FreeMusic => :Mix_FreeMusic,
    :Mix_GetNumChunkDecoders => :Mix_GetNumChunkDecoders,
    :Mix_GetChunkDecoder => :Mix_GetChunkDecoder,
    :Mix_HasChunkDecoder => :Mix_HasChunkDecoder,
    :Mix_GetNumMusicDecoders => :Mix_GetNumMusicDecoders,
    :Mix_GetMusicDecoder => :Mix_GetMusicDecoder,
    :Mix_HasMusicDecoder => :Mix_HasMusicDecoder,
    :Mix_GetMusicType => :Mix_GetMusicType,
    :Mix_GetMusicTitle => :Mix_GetMusicTitle,
    :Mix_GetMusicTitleTag => :Mix_GetMusicTitleTag,
    :Mix_GetMusicArtistTag => :Mix_GetMusicArtistTag,
    :Mix_GetMusicAlbumTag => :Mix_GetMusicAlbumTag,
    :Mix_GetMusicCopyrightTag => :Mix_GetMusicCopyrightTag,
    :Mix_SetPostMix => :Mix_SetPostMix,
    :Mix_HookMusic => :Mix_HookMusic,
    :Mix_HookMusicFinished => :Mix_HookMusicFinished,
    :Mix_GetMusicHookData => :Mix_GetMusicHookData,
    :Mix_ChannelFinished => :Mix_ChannelFinished,
    :Mix_RegisterEffect => :Mix_RegisterEffect,
    :Mix_UnregisterEffect => :Mix_UnregisterEffect,
    :Mix_UnregisterAllEffects => :Mix_UnregisterAllEffects,
    :Mix_SetPanning => :Mix_SetPanning,
    :Mix_SetPosition => :Mix_SetPosition,
    :Mix_SetDistance => :Mix_SetDistance,
    :Mix_SetReverseStereo => :Mix_SetReverseStereo,
    :Mix_ReserveChannels => :Mix_ReserveChannels,
    :Mix_GroupChannel => :Mix_GroupChannel,
    :Mix_GroupChannels => :Mix_GroupChannels,
    :Mix_GroupAvailable => :Mix_GroupAvailable,
    :Mix_GroupCount => :Mix_GroupCount,
    :Mix_GroupOldest => :Mix_GroupOldest,
    :Mix_GroupNewer => :Mix_GroupNewer,
    :Mix_PlayChannel => :Mix_PlayChannel,
    :Mix_PlayChannelTimed => :Mix_PlayChannelTimed,
    :Mix_PlayMusic => :Mix_PlayMusic,
    :Mix_FadeInMusic => :Mix_FadeInMusic,
    :Mix_FadeInMusicPos => :Mix_FadeInMusicPos,
    :Mix_FadeInChannel => :Mix_FadeInChannel,
    :Mix_FadeInChannelTimed => :Mix_FadeInChannelTimed,
    :Mix_Volume => :Mix_Volume,
    :Mix_VolumeChunk => :Mix_VolumeChunk,
    :Mix_VolumeMusic => :Mix_VolumeMusic,
    :Mix_GetMusicVolume => :Mix_GetMusicVolume,
    :Mix_MasterVolume => :Mix_MasterVolume,
    :Mix_HaltChannel => :Mix_HaltChannel,
    :Mix_HaltGroup => :Mix_HaltGroup,
    :Mix_HaltMusic => :Mix_HaltMusic,
    :Mix_ExpireChannel => :Mix_ExpireChannel,
    :Mix_FadeOutChannel => :Mix_FadeOutChannel,
    :Mix_FadeOutGroup => :Mix_FadeOutGroup,
    :Mix_FadeOutMusic => :Mix_FadeOutMusic,
    :Mix_FadingMusic => :Mix_FadingMusic,
    :Mix_FadingChannel => :Mix_FadingChannel,
    :Mix_Pause => :Mix_Pause,
    :Mix_Resume => :Mix_Resume,
    :Mix_Paused => :Mix_Paused,
    :Mix_PauseMusic => :Mix_PauseMusic,
    :Mix_ResumeMusic => :Mix_ResumeMusic,
    :Mix_RewindMusic => :Mix_RewindMusic,
    :Mix_PausedMusic => :Mix_PausedMusic,
    :Mix_ModMusicJumpToOrder => :Mix_ModMusicJumpToOrder,
    :Mix_StartTrack => :Mix_StartTrack,
    :Mix_GetNumTracks => :Mix_GetNumTracks,
    :Mix_SetMusicPosition => :Mix_SetMusicPosition,
    :Mix_GetMusicPosition => :Mix_GetMusicPosition,
    :Mix_MusicDuration => :Mix_MusicDuration,
    :Mix_GetMusicLoopStartTime => :Mix_GetMusicLoopStartTime,
    :Mix_GetMusicLoopEndTime => :Mix_GetMusicLoopEndTime,
    :Mix_GetMusicLoopLengthTime => :Mix_GetMusicLoopLengthTime,
    :Mix_Playing => :Mix_Playing,
    :Mix_PlayingMusic => :Mix_PlayingMusic,
    :Mix_SetMusicCMD => :Mix_SetMusicCMD,
    :Mix_SetSynchroValue => :Mix_SetSynchroValue,
    :Mix_GetSynchroValue => :Mix_GetSynchroValue,
    :Mix_SetSoundFonts => :Mix_SetSoundFonts,
    :Mix_GetSoundFonts => :Mix_GetSoundFonts,
    :Mix_EachSoundFont => :Mix_EachSoundFont,
    :Mix_SetTimidityCfg => :Mix_SetTimidityCfg,
    :Mix_GetTimidityCfg => :Mix_GetTimidityCfg,
    :Mix_GetChunk => :Mix_GetChunk,
    :Mix_CloseAudio => :Mix_CloseAudio,
  }
  args = {
    :Mix_Linked_Version => [],
    :Mix_Init => [:int],
    :Mix_Quit => [],
    :Mix_OpenAudio => [:int, :ushort, :int, :int],
    :Mix_OpenAudioDevice => [:int, :ushort, :int, :int, :pointer, :int],
    :Mix_PauseAudio => [:int],
    :Mix_QuerySpec => [:pointer, :pointer, :pointer],
    :Mix_AllocateChannels => [:int],
    :Mix_LoadWAV_RW => [:pointer, :int],
    :Mix_LoadWAV => [:pointer],
    :Mix_LoadMUS => [:pointer],
    :Mix_LoadMUS_RW => [:pointer, :int],
    :Mix_LoadMUSType_RW => [:pointer, :int, :int],
    :Mix_QuickLoad_WAV => [:pointer],
    :Mix_QuickLoad_RAW => [:pointer, :uint],
    :Mix_FreeChunk => [:pointer],
    :Mix_FreeMusic => [:pointer],
    :Mix_GetNumChunkDecoders => [],
    :Mix_GetChunkDecoder => [:int],
    :Mix_HasChunkDecoder => [:pointer],
    :Mix_GetNumMusicDecoders => [],
    :Mix_GetMusicDecoder => [:int],
    :Mix_HasMusicDecoder => [:pointer],
    :Mix_GetMusicType => [:pointer],
    :Mix_GetMusicTitle => [:pointer],
    :Mix_GetMusicTitleTag => [:pointer],
    :Mix_GetMusicArtistTag => [:pointer],
    :Mix_GetMusicAlbumTag => [:pointer],
    :Mix_GetMusicCopyrightTag => [:pointer],
    :Mix_SetPostMix => [:pointer, :pointer],
    :Mix_HookMusic => [:pointer, :pointer],
    :Mix_HookMusicFinished => [:pointer],
    :Mix_GetMusicHookData => [],
    :Mix_ChannelFinished => [:pointer],
    :Mix_RegisterEffect => [:int, :Mix_EffectFunc_t, :Mix_EffectDone_t, :pointer],
    :Mix_UnregisterEffect => [:int, :Mix_EffectFunc_t],
    :Mix_UnregisterAllEffects => [:int],
    :Mix_SetPanning => [:int, :uchar, :uchar],
    :Mix_SetPosition => [:int, :short, :uchar],
    :Mix_SetDistance => [:int, :uchar],
    :Mix_SetReverseStereo => [:int, :int],
    :Mix_ReserveChannels => [:int],
    :Mix_GroupChannel => [:int, :int],
    :Mix_GroupChannels => [:int, :int, :int],
    :Mix_GroupAvailable => [:int],
    :Mix_GroupCount => [:int],
    :Mix_GroupOldest => [:int],
    :Mix_GroupNewer => [:int],
    :Mix_PlayChannel => [:int, :pointer, :int],
    :Mix_PlayChannelTimed => [:int, :pointer, :int, :int],
    :Mix_PlayMusic => [:pointer, :int],
    :Mix_FadeInMusic => [:pointer, :int, :int],
    :Mix_FadeInMusicPos => [:pointer, :int, :int, :double],
    :Mix_FadeInChannel => [:int, :pointer, :int, :int],
    :Mix_FadeInChannelTimed => [:int, :pointer, :int, :int, :int],
    :Mix_Volume => [:int, :int],
    :Mix_VolumeChunk => [:pointer, :int],
    :Mix_VolumeMusic => [:int],
    :Mix_GetMusicVolume => [:pointer],
    :Mix_MasterVolume => [:int],
    :Mix_HaltChannel => [:int],
    :Mix_HaltGroup => [:int],
    :Mix_HaltMusic => [],
    :Mix_ExpireChannel => [:int, :int],
    :Mix_FadeOutChannel => [:int, :int],
    :Mix_FadeOutGroup => [:int, :int],
    :Mix_FadeOutMusic => [:int],
    :Mix_FadingMusic => [],
    :Mix_FadingChannel => [:int],
    :Mix_Pause => [:int],
    :Mix_Resume => [:int],
    :Mix_Paused => [:int],
    :Mix_PauseMusic => [],
    :Mix_ResumeMusic => [],
    :Mix_RewindMusic => [],
    :Mix_PausedMusic => [],
    :Mix_ModMusicJumpToOrder => [:int],
    :Mix_StartTrack => [:pointer, :int],
    :Mix_GetNumTracks => [:pointer],
    :Mix_SetMusicPosition => [:double],
    :Mix_GetMusicPosition => [:pointer],
    :Mix_MusicDuration => [:pointer],
    :Mix_GetMusicLoopStartTime => [:pointer],
    :Mix_GetMusicLoopEndTime => [:pointer],
    :Mix_GetMusicLoopLengthTime => [:pointer],
    :Mix_Playing => [:int],
    :Mix_PlayingMusic => [],
    :Mix_SetMusicCMD => [:pointer],
    :Mix_SetSynchroValue => [:int],
    :Mix_GetSynchroValue => [],
    :Mix_SetSoundFonts => [:pointer],
    :Mix_GetSoundFonts => [],
    :Mix_EachSoundFont => [:pointer, :pointer],
    :Mix_SetTimidityCfg => [:pointer],
    :Mix_GetTimidityCfg => [],
    :Mix_GetChunk => [:int],
    :Mix_CloseAudio => [],
  }
  retvals = {
    :Mix_Linked_Version => :pointer,
    :Mix_Init => :int,
    :Mix_Quit => :void,
    :Mix_OpenAudio => :int,
    :Mix_OpenAudioDevice => :int,
    :Mix_PauseAudio => :void,
    :Mix_QuerySpec => :int,
    :Mix_AllocateChannels => :int,
    :Mix_LoadWAV_RW => :pointer,
    :Mix_LoadWAV => :pointer,
    :Mix_LoadMUS => :pointer,
    :Mix_LoadMUS_RW => :pointer,
    :Mix_LoadMUSType_RW => :pointer,
    :Mix_QuickLoad_WAV => :pointer,
    :Mix_QuickLoad_RAW => :pointer,
    :Mix_FreeChunk => :void,
    :Mix_FreeMusic => :void,
    :Mix_GetNumChunkDecoders => :int,
    :Mix_GetChunkDecoder => :pointer,
    :Mix_HasChunkDecoder => :int,
    :Mix_GetNumMusicDecoders => :int,
    :Mix_GetMusicDecoder => :pointer,
    :Mix_HasMusicDecoder => :int,
    :Mix_GetMusicType => :int,
    :Mix_GetMusicTitle => :pointer,
    :Mix_GetMusicTitleTag => :pointer,
    :Mix_GetMusicArtistTag => :pointer,
    :Mix_GetMusicAlbumTag => :pointer,
    :Mix_GetMusicCopyrightTag => :pointer,
    :Mix_SetPostMix => :void,
    :Mix_HookMusic => :void,
    :Mix_HookMusicFinished => :void,
    :Mix_GetMusicHookData => :pointer,
    :Mix_ChannelFinished => :void,
    :Mix_RegisterEffect => :int,
    :Mix_UnregisterEffect => :int,
    :Mix_UnregisterAllEffects => :int,
    :Mix_SetPanning => :int,
    :Mix_SetPosition => :int,
    :Mix_SetDistance => :int,
    :Mix_SetReverseStereo => :int,
    :Mix_ReserveChannels => :int,
    :Mix_GroupChannel => :int,
    :Mix_GroupChannels => :int,
    :Mix_GroupAvailable => :int,
    :Mix_GroupCount => :int,
    :Mix_GroupOldest => :int,
    :Mix_GroupNewer => :int,
    :Mix_PlayChannel => :int,
    :Mix_PlayChannelTimed => :int,
    :Mix_PlayMusic => :int,
    :Mix_FadeInMusic => :int,
    :Mix_FadeInMusicPos => :int,
    :Mix_FadeInChannel => :int,
    :Mix_FadeInChannelTimed => :int,
    :Mix_Volume => :int,
    :Mix_VolumeChunk => :int,
    :Mix_VolumeMusic => :int,
    :Mix_GetMusicVolume => :int,
    :Mix_MasterVolume => :int,
    :Mix_HaltChannel => :int,
    :Mix_HaltGroup => :int,
    :Mix_HaltMusic => :int,
    :Mix_ExpireChannel => :int,
    :Mix_FadeOutChannel => :int,
    :Mix_FadeOutGroup => :int,
    :Mix_FadeOutMusic => :int,
    :Mix_FadingMusic => :int,
    :Mix_FadingChannel => :int,
    :Mix_Pause => :void,
    :Mix_Resume => :void,
    :Mix_Paused => :int,
    :Mix_PauseMusic => :void,
    :Mix_ResumeMusic => :void,
    :Mix_RewindMusic => :void,
    :Mix_PausedMusic => :int,
    :Mix_ModMusicJumpToOrder => :int,
    :Mix_StartTrack => :int,
    :Mix_GetNumTracks => :int,
    :Mix_SetMusicPosition => :int,
    :Mix_GetMusicPosition => :double,
    :Mix_MusicDuration => :double,
    :Mix_GetMusicLoopStartTime => :double,
    :Mix_GetMusicLoopEndTime => :double,
    :Mix_GetMusicLoopLengthTime => :double,
    :Mix_Playing => :int,
    :Mix_PlayingMusic => :int,
    :Mix_SetMusicCMD => :int,
    :Mix_SetSynchroValue => :int,
    :Mix_GetSynchroValue => :int,
    :Mix_SetSoundFonts => :int,
    :Mix_GetSoundFonts => :pointer,
    :Mix_EachSoundFont => :int,
    :Mix_SetTimidityCfg => :int,
    :Mix_GetTimidityCfg => :pointer,
    :Mix_GetChunk => :pointer,
    :Mix_CloseAudio => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_mouse_symbols(output_error = false) ⇒ Object

Function



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/sdl2_mouse.rb', line 47

def self.setup_mouse_symbols(output_error = false)
  symbols = [
    :SDL_GetMouseFocus,
    :SDL_GetMouseState,
    :SDL_GetGlobalMouseState,
    :SDL_GetRelativeMouseState,
    :SDL_WarpMouseInWindow,
    :SDL_WarpMouseGlobal,
    :SDL_SetRelativeMouseMode,
    :SDL_CaptureMouse,
    :SDL_GetRelativeMouseMode,
    :SDL_CreateCursor,
    :SDL_CreateColorCursor,
    :SDL_CreateSystemCursor,
    :SDL_SetCursor,
    :SDL_GetCursor,
    :SDL_GetDefaultCursor,
    :SDL_FreeCursor,
    :SDL_ShowCursor,
  ]
  apis = {
    :SDL_GetMouseFocus => :GetMouseFocus,
    :SDL_GetMouseState => :GetMouseState,
    :SDL_GetGlobalMouseState => :GetGlobalMouseState,
    :SDL_GetRelativeMouseState => :GetRelativeMouseState,
    :SDL_WarpMouseInWindow => :WarpMouseInWindow,
    :SDL_WarpMouseGlobal => :WarpMouseGlobal,
    :SDL_SetRelativeMouseMode => :SetRelativeMouseMode,
    :SDL_CaptureMouse => :CaptureMouse,
    :SDL_GetRelativeMouseMode => :GetRelativeMouseMode,
    :SDL_CreateCursor => :CreateCursor,
    :SDL_CreateColorCursor => :CreateColorCursor,
    :SDL_CreateSystemCursor => :CreateSystemCursor,
    :SDL_SetCursor => :SetCursor,
    :SDL_GetCursor => :GetCursor,
    :SDL_GetDefaultCursor => :GetDefaultCursor,
    :SDL_FreeCursor => :FreeCursor,
    :SDL_ShowCursor => :ShowCursor,
  }
  args = {
    :SDL_GetMouseFocus => [],
    :SDL_GetMouseState => [:pointer, :pointer],
    :SDL_GetGlobalMouseState => [:pointer, :pointer],
    :SDL_GetRelativeMouseState => [:pointer, :pointer],
    :SDL_WarpMouseInWindow => [:pointer, :int, :int],
    :SDL_WarpMouseGlobal => [:int, :int],
    :SDL_SetRelativeMouseMode => [:int],
    :SDL_CaptureMouse => [:int],
    :SDL_GetRelativeMouseMode => [],
    :SDL_CreateCursor => [:pointer, :pointer, :int, :int, :int, :int],
    :SDL_CreateColorCursor => [:pointer, :int, :int],
    :SDL_CreateSystemCursor => [:int],
    :SDL_SetCursor => [:pointer],
    :SDL_GetCursor => [],
    :SDL_GetDefaultCursor => [],
    :SDL_FreeCursor => [:pointer],
    :SDL_ShowCursor => [:int],
  }
  retvals = {
    :SDL_GetMouseFocus => :pointer,
    :SDL_GetMouseState => :uint,
    :SDL_GetGlobalMouseState => :uint,
    :SDL_GetRelativeMouseState => :uint,
    :SDL_WarpMouseInWindow => :void,
    :SDL_WarpMouseGlobal => :int,
    :SDL_SetRelativeMouseMode => :int,
    :SDL_CaptureMouse => :int,
    :SDL_GetRelativeMouseMode => :int,
    :SDL_CreateCursor => :pointer,
    :SDL_CreateColorCursor => :pointer,
    :SDL_CreateSystemCursor => :pointer,
    :SDL_SetCursor => :void,
    :SDL_GetCursor => :pointer,
    :SDL_GetDefaultCursor => :pointer,
    :SDL_FreeCursor => :void,
    :SDL_ShowCursor => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_pixels_symbols(output_error = false) ⇒ Object

Function



172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
# File 'lib/sdl2_pixels.rb', line 172

def self.setup_pixels_symbols(output_error = false)
  symbols = [
    :SDL_GetPixelFormatName,
    :SDL_PixelFormatEnumToMasks,
    :SDL_MasksToPixelFormatEnum,
    :SDL_AllocFormat,
    :SDL_FreeFormat,
    :SDL_AllocPalette,
    :SDL_SetPixelFormatPalette,
    :SDL_SetPaletteColors,
    :SDL_FreePalette,
    :SDL_MapRGB,
    :SDL_MapRGBA,
    :SDL_GetRGB,
    :SDL_GetRGBA,
    :SDL_CalculateGammaRamp,
  ]
  apis = {
    :SDL_GetPixelFormatName => :GetPixelFormatName,
    :SDL_PixelFormatEnumToMasks => :PixelFormatEnumToMasks,
    :SDL_MasksToPixelFormatEnum => :MasksToPixelFormatEnum,
    :SDL_AllocFormat => :AllocFormat,
    :SDL_FreeFormat => :FreeFormat,
    :SDL_AllocPalette => :AllocPalette,
    :SDL_SetPixelFormatPalette => :SetPixelFormatPalette,
    :SDL_SetPaletteColors => :SetPaletteColors,
    :SDL_FreePalette => :FreePalette,
    :SDL_MapRGB => :MapRGB,
    :SDL_MapRGBA => :MapRGBA,
    :SDL_GetRGB => :GetRGB,
    :SDL_GetRGBA => :GetRGBA,
    :SDL_CalculateGammaRamp => :CalculateGammaRamp,
  }
  args = {
    :SDL_GetPixelFormatName => [:uint],
    :SDL_PixelFormatEnumToMasks => [:uint, :pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_MasksToPixelFormatEnum => [:int, :uint, :uint, :uint, :uint],
    :SDL_AllocFormat => [:uint],
    :SDL_FreeFormat => [:pointer],
    :SDL_AllocPalette => [:int],
    :SDL_SetPixelFormatPalette => [:pointer, :pointer],
    :SDL_SetPaletteColors => [:pointer, :pointer, :int, :int],
    :SDL_FreePalette => [:pointer],
    :SDL_MapRGB => [:pointer, :uchar, :uchar, :uchar],
    :SDL_MapRGBA => [:pointer, :uchar, :uchar, :uchar, :uchar],
    :SDL_GetRGB => [:uint, :pointer, :pointer, :pointer, :pointer],
    :SDL_GetRGBA => [:uint, :pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_CalculateGammaRamp => [:float, :pointer],
  }
  retvals = {
    :SDL_GetPixelFormatName => :pointer,
    :SDL_PixelFormatEnumToMasks => :int,
    :SDL_MasksToPixelFormatEnum => :uint,
    :SDL_AllocFormat => :pointer,
    :SDL_FreeFormat => :void,
    :SDL_AllocPalette => :pointer,
    :SDL_SetPixelFormatPalette => :int,
    :SDL_SetPaletteColors => :int,
    :SDL_FreePalette => :void,
    :SDL_MapRGB => :uint,
    :SDL_MapRGBA => :uint,
    :SDL_GetRGB => :void,
    :SDL_GetRGBA => :void,
    :SDL_CalculateGammaRamp => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_platform_symbols(output_error = false) ⇒ Object

Function



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/sdl2_platform.rb', line 25

def self.setup_platform_symbols(output_error = false)
  symbols = [
    :SDL_GetPlatform,
  ]
  apis = {
    :SDL_GetPlatform => :GetPlatform,
  }
  args = {
    :SDL_GetPlatform => [],
  }
  retvals = {
    :SDL_GetPlatform => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_power_symbols(output_error = false) ⇒ Object

Function



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/sdl2_power.rb', line 31

def self.setup_power_symbols(output_error = false)
  symbols = [
    :SDL_GetPowerInfo,
  ]
  apis = {
    :SDL_GetPowerInfo => :GetPowerInfo,
  }
  args = {
    :SDL_GetPowerInfo => [:pointer, :pointer],
  }
  retvals = {
    :SDL_GetPowerInfo => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_rect_symbols(output_error = false) ⇒ Object

Function



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# File 'lib/sdl2_rect.rb', line 70

def self.setup_rect_symbols(output_error = false)
  symbols = [
    :SDL_HasIntersection,
    :SDL_IntersectRect,
    :SDL_UnionRect,
    :SDL_EnclosePoints,
    :SDL_IntersectRectAndLine,
    :SDL_PointInFRect,
    :SDL_FRectEmpty,
    :SDL_FRectEqualsEpsilon,
    :SDL_FRectEquals,
    :SDL_HasIntersectionF,
    :SDL_IntersectFRect,
    :SDL_UnionFRect,
    :SDL_EncloseFPoints,
    :SDL_IntersectFRectAndLine,
  ]
  apis = {
    :SDL_HasIntersection => :HasIntersection,
    :SDL_IntersectRect => :IntersectRect,
    :SDL_UnionRect => :UnionRect,
    :SDL_EnclosePoints => :EnclosePoints,
    :SDL_IntersectRectAndLine => :IntersectRectAndLine,
    :SDL_PointInFRect => :PointInFRect,
    :SDL_FRectEmpty => :FRectEmpty,
    :SDL_FRectEqualsEpsilon => :FRectEqualsEpsilon,
    :SDL_FRectEquals => :FRectEquals,
    :SDL_HasIntersectionF => :HasIntersectionF,
    :SDL_IntersectFRect => :IntersectFRect,
    :SDL_UnionFRect => :UnionFRect,
    :SDL_EncloseFPoints => :EncloseFPoints,
    :SDL_IntersectFRectAndLine => :IntersectFRectAndLine,
  }
  args = {
    :SDL_HasIntersection => [:pointer, :pointer],
    :SDL_IntersectRect => [:pointer, :pointer, :pointer],
    :SDL_UnionRect => [:pointer, :pointer, :pointer],
    :SDL_EnclosePoints => [:pointer, :int, :pointer, :pointer],
    :SDL_IntersectRectAndLine => [:pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_PointInFRect => [:pointer, :pointer],
    :SDL_FRectEmpty => [:pointer],
    :SDL_FRectEqualsEpsilon => [:pointer, :pointer, :float],
    :SDL_FRectEquals => [:pointer, :pointer],
    :SDL_HasIntersectionF => [:pointer, :pointer],
    :SDL_IntersectFRect => [:pointer, :pointer, :pointer],
    :SDL_UnionFRect => [:pointer, :pointer, :pointer],
    :SDL_EncloseFPoints => [:pointer, :int, :pointer, :pointer],
    :SDL_IntersectFRectAndLine => [:pointer, :pointer, :pointer, :pointer, :pointer],
  }
  retvals = {
    :SDL_HasIntersection => :int,
    :SDL_IntersectRect => :int,
    :SDL_UnionRect => :void,
    :SDL_EnclosePoints => :int,
    :SDL_IntersectRectAndLine => :int,
    :SDL_PointInFRect => :int,
    :SDL_FRectEmpty => :int,
    :SDL_FRectEqualsEpsilon => :int,
    :SDL_FRectEquals => :int,
    :SDL_HasIntersectionF => :int,
    :SDL_IntersectFRect => :int,
    :SDL_UnionFRect => :void,
    :SDL_EncloseFPoints => :int,
    :SDL_IntersectFRectAndLine => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_render_symbols(output_error = false) ⇒ Object

Function



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/sdl2_render.rb', line 65

def self.setup_render_symbols(output_error = false)
  symbols = [
    :SDL_GetNumRenderDrivers,
    :SDL_GetRenderDriverInfo,
    :SDL_CreateWindowAndRenderer,
    :SDL_CreateRenderer,
    :SDL_CreateSoftwareRenderer,
    :SDL_GetRenderer,
    :SDL_RenderGetWindow,
    :SDL_GetRendererInfo,
    :SDL_GetRendererOutputSize,
    :SDL_CreateTexture,
    :SDL_CreateTextureFromSurface,
    :SDL_QueryTexture,
    :SDL_SetTextureColorMod,
    :SDL_GetTextureColorMod,
    :SDL_SetTextureAlphaMod,
    :SDL_GetTextureAlphaMod,
    :SDL_SetTextureBlendMode,
    :SDL_GetTextureBlendMode,
    :SDL_SetTextureScaleMode,
    :SDL_GetTextureScaleMode,
    :SDL_SetTextureUserData,
    :SDL_GetTextureUserData,
    :SDL_UpdateTexture,
    :SDL_UpdateYUVTexture,
    :SDL_UpdateNVTexture,
    :SDL_LockTexture,
    :SDL_LockTextureToSurface,
    :SDL_UnlockTexture,
    :SDL_RenderTargetSupported,
    :SDL_SetRenderTarget,
    :SDL_GetRenderTarget,
    :SDL_RenderSetLogicalSize,
    :SDL_RenderGetLogicalSize,
    :SDL_RenderSetIntegerScale,
    :SDL_RenderGetIntegerScale,
    :SDL_RenderSetViewport,
    :SDL_RenderGetViewport,
    :SDL_RenderSetClipRect,
    :SDL_RenderGetClipRect,
    :SDL_RenderIsClipEnabled,
    :SDL_RenderSetScale,
    :SDL_RenderGetScale,
    :SDL_RenderWindowToLogical,
    :SDL_RenderLogicalToWindow,
    :SDL_SetRenderDrawColor,
    :SDL_GetRenderDrawColor,
    :SDL_SetRenderDrawBlendMode,
    :SDL_GetRenderDrawBlendMode,
    :SDL_RenderClear,
    :SDL_RenderDrawPoint,
    :SDL_RenderDrawPoints,
    :SDL_RenderDrawLine,
    :SDL_RenderDrawLines,
    :SDL_RenderDrawRect,
    :SDL_RenderDrawRects,
    :SDL_RenderFillRect,
    :SDL_RenderFillRects,
    :SDL_RenderCopy,
    :SDL_RenderCopyEx,
    :SDL_RenderDrawPointF,
    :SDL_RenderDrawPointsF,
    :SDL_RenderDrawLineF,
    :SDL_RenderDrawLinesF,
    :SDL_RenderDrawRectF,
    :SDL_RenderDrawRectsF,
    :SDL_RenderFillRectF,
    :SDL_RenderFillRectsF,
    :SDL_RenderCopyF,
    :SDL_RenderCopyExF,
    :SDL_RenderGeometry,
    :SDL_RenderGeometryRaw,
    :SDL_RenderReadPixels,
    :SDL_RenderPresent,
    :SDL_DestroyTexture,
    :SDL_DestroyRenderer,
    :SDL_RenderFlush,
    :SDL_GL_BindTexture,
    :SDL_GL_UnbindTexture,
    :SDL_RenderGetMetalLayer,
    :SDL_RenderGetMetalCommandEncoder,
    :SDL_RenderSetVSync,
  ]
  apis = {
    :SDL_GetNumRenderDrivers => :GetNumRenderDrivers,
    :SDL_GetRenderDriverInfo => :GetRenderDriverInfo,
    :SDL_CreateWindowAndRenderer => :CreateWindowAndRenderer,
    :SDL_CreateRenderer => :CreateRenderer,
    :SDL_CreateSoftwareRenderer => :CreateSoftwareRenderer,
    :SDL_GetRenderer => :GetRenderer,
    :SDL_RenderGetWindow => :RenderGetWindow,
    :SDL_GetRendererInfo => :GetRendererInfo,
    :SDL_GetRendererOutputSize => :GetRendererOutputSize,
    :SDL_CreateTexture => :CreateTexture,
    :SDL_CreateTextureFromSurface => :CreateTextureFromSurface,
    :SDL_QueryTexture => :QueryTexture,
    :SDL_SetTextureColorMod => :SetTextureColorMod,
    :SDL_GetTextureColorMod => :GetTextureColorMod,
    :SDL_SetTextureAlphaMod => :SetTextureAlphaMod,
    :SDL_GetTextureAlphaMod => :GetTextureAlphaMod,
    :SDL_SetTextureBlendMode => :SetTextureBlendMode,
    :SDL_GetTextureBlendMode => :GetTextureBlendMode,
    :SDL_SetTextureScaleMode => :SetTextureScaleMode,
    :SDL_GetTextureScaleMode => :GetTextureScaleMode,
    :SDL_SetTextureUserData => :SetTextureUserData,
    :SDL_GetTextureUserData => :GetTextureUserData,
    :SDL_UpdateTexture => :UpdateTexture,
    :SDL_UpdateYUVTexture => :UpdateYUVTexture,
    :SDL_UpdateNVTexture => :UpdateNVTexture,
    :SDL_LockTexture => :LockTexture,
    :SDL_LockTextureToSurface => :LockTextureToSurface,
    :SDL_UnlockTexture => :UnlockTexture,
    :SDL_RenderTargetSupported => :RenderTargetSupported,
    :SDL_SetRenderTarget => :SetRenderTarget,
    :SDL_GetRenderTarget => :GetRenderTarget,
    :SDL_RenderSetLogicalSize => :RenderSetLogicalSize,
    :SDL_RenderGetLogicalSize => :RenderGetLogicalSize,
    :SDL_RenderSetIntegerScale => :RenderSetIntegerScale,
    :SDL_RenderGetIntegerScale => :RenderGetIntegerScale,
    :SDL_RenderSetViewport => :RenderSetViewport,
    :SDL_RenderGetViewport => :RenderGetViewport,
    :SDL_RenderSetClipRect => :RenderSetClipRect,
    :SDL_RenderGetClipRect => :RenderGetClipRect,
    :SDL_RenderIsClipEnabled => :RenderIsClipEnabled,
    :SDL_RenderSetScale => :RenderSetScale,
    :SDL_RenderGetScale => :RenderGetScale,
    :SDL_RenderWindowToLogical => :RenderWindowToLogical,
    :SDL_RenderLogicalToWindow => :RenderLogicalToWindow,
    :SDL_SetRenderDrawColor => :SetRenderDrawColor,
    :SDL_GetRenderDrawColor => :GetRenderDrawColor,
    :SDL_SetRenderDrawBlendMode => :SetRenderDrawBlendMode,
    :SDL_GetRenderDrawBlendMode => :GetRenderDrawBlendMode,
    :SDL_RenderClear => :RenderClear,
    :SDL_RenderDrawPoint => :RenderDrawPoint,
    :SDL_RenderDrawPoints => :RenderDrawPoints,
    :SDL_RenderDrawLine => :RenderDrawLine,
    :SDL_RenderDrawLines => :RenderDrawLines,
    :SDL_RenderDrawRect => :RenderDrawRect,
    :SDL_RenderDrawRects => :RenderDrawRects,
    :SDL_RenderFillRect => :RenderFillRect,
    :SDL_RenderFillRects => :RenderFillRects,
    :SDL_RenderCopy => :RenderCopy,
    :SDL_RenderCopyEx => :RenderCopyEx,
    :SDL_RenderDrawPointF => :RenderDrawPointF,
    :SDL_RenderDrawPointsF => :RenderDrawPointsF,
    :SDL_RenderDrawLineF => :RenderDrawLineF,
    :SDL_RenderDrawLinesF => :RenderDrawLinesF,
    :SDL_RenderDrawRectF => :RenderDrawRectF,
    :SDL_RenderDrawRectsF => :RenderDrawRectsF,
    :SDL_RenderFillRectF => :RenderFillRectF,
    :SDL_RenderFillRectsF => :RenderFillRectsF,
    :SDL_RenderCopyF => :RenderCopyF,
    :SDL_RenderCopyExF => :RenderCopyExF,
    :SDL_RenderGeometry => :RenderGeometry,
    :SDL_RenderGeometryRaw => :RenderGeometryRaw,
    :SDL_RenderReadPixels => :RenderReadPixels,
    :SDL_RenderPresent => :RenderPresent,
    :SDL_DestroyTexture => :DestroyTexture,
    :SDL_DestroyRenderer => :DestroyRenderer,
    :SDL_RenderFlush => :RenderFlush,
    :SDL_GL_BindTexture => :GL_BindTexture,
    :SDL_GL_UnbindTexture => :GL_UnbindTexture,
    :SDL_RenderGetMetalLayer => :RenderGetMetalLayer,
    :SDL_RenderGetMetalCommandEncoder => :RenderGetMetalCommandEncoder,
    :SDL_RenderSetVSync => :RenderSetVSync,
  }
  args = {
    :SDL_GetNumRenderDrivers => [],
    :SDL_GetRenderDriverInfo => [:int, :pointer],
    :SDL_CreateWindowAndRenderer => [:int, :int, :uint, :pointer, :pointer],
    :SDL_CreateRenderer => [:pointer, :int, :uint],
    :SDL_CreateSoftwareRenderer => [:pointer],
    :SDL_GetRenderer => [:pointer],
    :SDL_RenderGetWindow => [:pointer],
    :SDL_GetRendererInfo => [:pointer, :pointer],
    :SDL_GetRendererOutputSize => [:pointer, :pointer, :pointer],
    :SDL_CreateTexture => [:pointer, :uint, :int, :int, :int],
    :SDL_CreateTextureFromSurface => [:pointer, :pointer],
    :SDL_QueryTexture => [:pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_SetTextureColorMod => [:pointer, :uchar, :uchar, :uchar],
    :SDL_GetTextureColorMod => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SetTextureAlphaMod => [:pointer, :uchar],
    :SDL_GetTextureAlphaMod => [:pointer, :pointer],
    :SDL_SetTextureBlendMode => [:pointer, :int],
    :SDL_GetTextureBlendMode => [:pointer, :pointer],
    :SDL_SetTextureScaleMode => [:pointer, :int],
    :SDL_GetTextureScaleMode => [:pointer, :pointer],
    :SDL_SetTextureUserData => [:pointer, :pointer],
    :SDL_GetTextureUserData => [:pointer],
    :SDL_UpdateTexture => [:pointer, :pointer, :pointer, :int],
    :SDL_UpdateYUVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int],
    :SDL_UpdateNVTexture => [:pointer, :pointer, :pointer, :int, :pointer, :int],
    :SDL_LockTexture => [:pointer, :pointer, :pointer, :pointer],
    :SDL_LockTextureToSurface => [:pointer, :pointer, :pointer],
    :SDL_UnlockTexture => [:pointer],
    :SDL_RenderTargetSupported => [:pointer],
    :SDL_SetRenderTarget => [:pointer, :pointer],
    :SDL_GetRenderTarget => [:pointer],
    :SDL_RenderSetLogicalSize => [:pointer, :int, :int],
    :SDL_RenderGetLogicalSize => [:pointer, :pointer, :pointer],
    :SDL_RenderSetIntegerScale => [:pointer, :int],
    :SDL_RenderGetIntegerScale => [:pointer],
    :SDL_RenderSetViewport => [:pointer, :pointer],
    :SDL_RenderGetViewport => [:pointer, :pointer],
    :SDL_RenderSetClipRect => [:pointer, :pointer],
    :SDL_RenderGetClipRect => [:pointer, :pointer],
    :SDL_RenderIsClipEnabled => [:pointer],
    :SDL_RenderSetScale => [:pointer, :float, :float],
    :SDL_RenderGetScale => [:pointer, :pointer, :pointer],
    :SDL_RenderWindowToLogical => [:pointer, :int, :int, :pointer, :pointer],
    :SDL_RenderLogicalToWindow => [:pointer, :float, :float, :pointer, :pointer],
    :SDL_SetRenderDrawColor => [:pointer, :uchar, :uchar, :uchar, :uchar],
    :SDL_GetRenderDrawColor => [:pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_SetRenderDrawBlendMode => [:pointer, :int],
    :SDL_GetRenderDrawBlendMode => [:pointer, :pointer],
    :SDL_RenderClear => [:pointer],
    :SDL_RenderDrawPoint => [:pointer, :int, :int],
    :SDL_RenderDrawPoints => [:pointer, :pointer, :int],
    :SDL_RenderDrawLine => [:pointer, :int, :int, :int, :int],
    :SDL_RenderDrawLines => [:pointer, :pointer, :int],
    :SDL_RenderDrawRect => [:pointer, :pointer],
    :SDL_RenderDrawRects => [:pointer, :pointer, :int],
    :SDL_RenderFillRect => [:pointer, :pointer],
    :SDL_RenderFillRects => [:pointer, :pointer, :int],
    :SDL_RenderCopy => [:pointer, :pointer, :pointer, :pointer],
    :SDL_RenderCopyEx => [:pointer, :pointer, :pointer, :pointer, :double, :pointer, :int],
    :SDL_RenderDrawPointF => [:pointer, :float, :float],
    :SDL_RenderDrawPointsF => [:pointer, :pointer, :int],
    :SDL_RenderDrawLineF => [:pointer, :float, :float, :float, :float],
    :SDL_RenderDrawLinesF => [:pointer, :pointer, :int],
    :SDL_RenderDrawRectF => [:pointer, :pointer],
    :SDL_RenderDrawRectsF => [:pointer, :pointer, :int],
    :SDL_RenderFillRectF => [:pointer, :pointer],
    :SDL_RenderFillRectsF => [:pointer, :pointer, :int],
    :SDL_RenderCopyF => [:pointer, :pointer, :pointer, :pointer],
    :SDL_RenderCopyExF => [:pointer, :pointer, :pointer, :pointer, :double, :pointer, :int],
    :SDL_RenderGeometry => [:pointer, :pointer, :pointer, :int, :pointer, :int],
    :SDL_RenderGeometryRaw => [:pointer, :pointer, :pointer, :int, :pointer, :int, :pointer, :int, :int, :pointer, :int, :int],
    :SDL_RenderReadPixels => [:pointer, :pointer, :uint, :pointer, :int],
    :SDL_RenderPresent => [:pointer],
    :SDL_DestroyTexture => [:pointer],
    :SDL_DestroyRenderer => [:pointer],
    :SDL_RenderFlush => [:pointer],
    :SDL_GL_BindTexture => [:pointer, :pointer, :pointer],
    :SDL_GL_UnbindTexture => [:pointer],
    :SDL_RenderGetMetalLayer => [:pointer],
    :SDL_RenderGetMetalCommandEncoder => [:pointer],
    :SDL_RenderSetVSync => [:pointer, :int],
  }
  retvals = {
    :SDL_GetNumRenderDrivers => :int,
    :SDL_GetRenderDriverInfo => :int,
    :SDL_CreateWindowAndRenderer => :int,
    :SDL_CreateRenderer => :pointer,
    :SDL_CreateSoftwareRenderer => :pointer,
    :SDL_GetRenderer => :pointer,
    :SDL_RenderGetWindow => :pointer,
    :SDL_GetRendererInfo => :int,
    :SDL_GetRendererOutputSize => :int,
    :SDL_CreateTexture => :pointer,
    :SDL_CreateTextureFromSurface => :pointer,
    :SDL_QueryTexture => :int,
    :SDL_SetTextureColorMod => :int,
    :SDL_GetTextureColorMod => :int,
    :SDL_SetTextureAlphaMod => :int,
    :SDL_GetTextureAlphaMod => :int,
    :SDL_SetTextureBlendMode => :int,
    :SDL_GetTextureBlendMode => :int,
    :SDL_SetTextureScaleMode => :int,
    :SDL_GetTextureScaleMode => :int,
    :SDL_SetTextureUserData => :int,
    :SDL_GetTextureUserData => :pointer,
    :SDL_UpdateTexture => :int,
    :SDL_UpdateYUVTexture => :int,
    :SDL_UpdateNVTexture => :int,
    :SDL_LockTexture => :int,
    :SDL_LockTextureToSurface => :int,
    :SDL_UnlockTexture => :void,
    :SDL_RenderTargetSupported => :int,
    :SDL_SetRenderTarget => :int,
    :SDL_GetRenderTarget => :pointer,
    :SDL_RenderSetLogicalSize => :int,
    :SDL_RenderGetLogicalSize => :void,
    :SDL_RenderSetIntegerScale => :int,
    :SDL_RenderGetIntegerScale => :int,
    :SDL_RenderSetViewport => :int,
    :SDL_RenderGetViewport => :void,
    :SDL_RenderSetClipRect => :int,
    :SDL_RenderGetClipRect => :void,
    :SDL_RenderIsClipEnabled => :int,
    :SDL_RenderSetScale => :int,
    :SDL_RenderGetScale => :void,
    :SDL_RenderWindowToLogical => :void,
    :SDL_RenderLogicalToWindow => :void,
    :SDL_SetRenderDrawColor => :int,
    :SDL_GetRenderDrawColor => :int,
    :SDL_SetRenderDrawBlendMode => :int,
    :SDL_GetRenderDrawBlendMode => :int,
    :SDL_RenderClear => :int,
    :SDL_RenderDrawPoint => :int,
    :SDL_RenderDrawPoints => :int,
    :SDL_RenderDrawLine => :int,
    :SDL_RenderDrawLines => :int,
    :SDL_RenderDrawRect => :int,
    :SDL_RenderDrawRects => :int,
    :SDL_RenderFillRect => :int,
    :SDL_RenderFillRects => :int,
    :SDL_RenderCopy => :int,
    :SDL_RenderCopyEx => :int,
    :SDL_RenderDrawPointF => :int,
    :SDL_RenderDrawPointsF => :int,
    :SDL_RenderDrawLineF => :int,
    :SDL_RenderDrawLinesF => :int,
    :SDL_RenderDrawRectF => :int,
    :SDL_RenderDrawRectsF => :int,
    :SDL_RenderFillRectF => :int,
    :SDL_RenderFillRectsF => :int,
    :SDL_RenderCopyF => :int,
    :SDL_RenderCopyExF => :int,
    :SDL_RenderGeometry => :int,
    :SDL_RenderGeometryRaw => :int,
    :SDL_RenderReadPixels => :int,
    :SDL_RenderPresent => :void,
    :SDL_DestroyTexture => :void,
    :SDL_DestroyRenderer => :void,
    :SDL_RenderFlush => :int,
    :SDL_GL_BindTexture => :int,
    :SDL_GL_UnbindTexture => :int,
    :SDL_RenderGetMetalLayer => :pointer,
    :SDL_RenderGetMetalCommandEncoder => :pointer,
    :SDL_RenderSetVSync => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_rwops_symbols(output_error = false) ⇒ Object

Function



111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
# File 'lib/sdl2_rwops.rb', line 111

def self.setup_rwops_symbols(output_error = false)
  symbols = [
    :SDL_RWFromFile,
    :SDL_RWFromFP,
    :SDL_RWFromMem,
    :SDL_RWFromConstMem,
    :SDL_AllocRW,
    :SDL_FreeRW,
    :SDL_RWsize,
    :SDL_RWseek,
    :SDL_RWtell,
    :SDL_RWread,
    :SDL_RWwrite,
    :SDL_RWclose,
    :SDL_LoadFile_RW,
    :SDL_LoadFile,
    :SDL_ReadU8,
    :SDL_ReadLE16,
    :SDL_ReadBE16,
    :SDL_ReadLE32,
    :SDL_ReadBE32,
    :SDL_ReadLE64,
    :SDL_ReadBE64,
    :SDL_WriteU8,
    :SDL_WriteLE16,
    :SDL_WriteBE16,
    :SDL_WriteLE32,
    :SDL_WriteBE32,
    :SDL_WriteLE64,
    :SDL_WriteBE64,
  ]
  apis = {
    :SDL_RWFromFile => :RWFromFile,
    :SDL_RWFromFP => :RWFromFP,
    :SDL_RWFromMem => :RWFromMem,
    :SDL_RWFromConstMem => :RWFromConstMem,
    :SDL_AllocRW => :AllocRW,
    :SDL_FreeRW => :FreeRW,
    :SDL_RWsize => :RWsize,
    :SDL_RWseek => :RWseek,
    :SDL_RWtell => :RWtell,
    :SDL_RWread => :RWread,
    :SDL_RWwrite => :RWwrite,
    :SDL_RWclose => :RWclose,
    :SDL_LoadFile_RW => :LoadFile_RW,
    :SDL_LoadFile => :LoadFile,
    :SDL_ReadU8 => :ReadU8,
    :SDL_ReadLE16 => :ReadLE16,
    :SDL_ReadBE16 => :ReadBE16,
    :SDL_ReadLE32 => :ReadLE32,
    :SDL_ReadBE32 => :ReadBE32,
    :SDL_ReadLE64 => :ReadLE64,
    :SDL_ReadBE64 => :ReadBE64,
    :SDL_WriteU8 => :WriteU8,
    :SDL_WriteLE16 => :WriteLE16,
    :SDL_WriteBE16 => :WriteBE16,
    :SDL_WriteLE32 => :WriteLE32,
    :SDL_WriteBE32 => :WriteBE32,
    :SDL_WriteLE64 => :WriteLE64,
    :SDL_WriteBE64 => :WriteBE64,
  }
  args = {
    :SDL_RWFromFile => [:pointer, :pointer],
    :SDL_RWFromFP => [:pointer, :int],
    :SDL_RWFromMem => [:pointer, :int],
    :SDL_RWFromConstMem => [:pointer, :int],
    :SDL_AllocRW => [],
    :SDL_FreeRW => [:pointer],
    :SDL_RWsize => [:pointer],
    :SDL_RWseek => [:pointer, :long_long, :int],
    :SDL_RWtell => [:pointer],
    :SDL_RWread => [:pointer, :pointer, :ulong, :ulong],
    :SDL_RWwrite => [:pointer, :pointer, :ulong, :ulong],
    :SDL_RWclose => [:pointer],
    :SDL_LoadFile_RW => [:pointer, :pointer, :int],
    :SDL_LoadFile => [:pointer, :pointer],
    :SDL_ReadU8 => [:pointer],
    :SDL_ReadLE16 => [:pointer],
    :SDL_ReadBE16 => [:pointer],
    :SDL_ReadLE32 => [:pointer],
    :SDL_ReadBE32 => [:pointer],
    :SDL_ReadLE64 => [:pointer],
    :SDL_ReadBE64 => [:pointer],
    :SDL_WriteU8 => [:pointer, :uchar],
    :SDL_WriteLE16 => [:pointer, :ushort],
    :SDL_WriteBE16 => [:pointer, :ushort],
    :SDL_WriteLE32 => [:pointer, :uint],
    :SDL_WriteBE32 => [:pointer, :uint],
    :SDL_WriteLE64 => [:pointer, :ulong_long],
    :SDL_WriteBE64 => [:pointer, :ulong_long],
  }
  retvals = {
    :SDL_RWFromFile => :pointer,
    :SDL_RWFromFP => :pointer,
    :SDL_RWFromMem => :pointer,
    :SDL_RWFromConstMem => :pointer,
    :SDL_AllocRW => :pointer,
    :SDL_FreeRW => :void,
    :SDL_RWsize => :long_long,
    :SDL_RWseek => :long_long,
    :SDL_RWtell => :long_long,
    :SDL_RWread => :ulong,
    :SDL_RWwrite => :ulong,
    :SDL_RWclose => :int,
    :SDL_LoadFile_RW => :pointer,
    :SDL_LoadFile => :pointer,
    :SDL_ReadU8 => :uchar,
    :SDL_ReadLE16 => :ushort,
    :SDL_ReadBE16 => :ushort,
    :SDL_ReadLE32 => :uint,
    :SDL_ReadBE32 => :uint,
    :SDL_ReadLE64 => :ulong_long,
    :SDL_ReadBE64 => :ulong_long,
    :SDL_WriteU8 => :ulong,
    :SDL_WriteLE16 => :ulong,
    :SDL_WriteBE16 => :ulong,
    :SDL_WriteLE32 => :ulong,
    :SDL_WriteBE32 => :ulong,
    :SDL_WriteLE64 => :ulong,
    :SDL_WriteBE64 => :ulong,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_scancode_symbols(output_error = false) ⇒ Object

Function



274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
# File 'lib/sdl2_scancode.rb', line 274

def self.setup_scancode_symbols(output_error = false)
  symbols = [
  ]
  apis = {
  }
  args = {
  }
  retvals = {
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_sensor_symbols(output_error = false) ⇒ Object

Function



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/sdl2_sensor.rb', line 36

def self.setup_sensor_symbols(output_error = false)
  symbols = [
    :SDL_LockSensors,
    :SDL_UnlockSensors,
    :SDL_NumSensors,
    :SDL_SensorGetDeviceName,
    :SDL_SensorGetDeviceType,
    :SDL_SensorGetDeviceNonPortableType,
    :SDL_SensorGetDeviceInstanceID,
    :SDL_SensorOpen,
    :SDL_SensorFromInstanceID,
    :SDL_SensorGetName,
    :SDL_SensorGetType,
    :SDL_SensorGetNonPortableType,
    :SDL_SensorGetInstanceID,
    :SDL_SensorGetData,
    :SDL_SensorGetDataWithTimestamp,
    :SDL_SensorClose,
    :SDL_SensorUpdate,
  ]
  apis = {
    :SDL_LockSensors => :LockSensors,
    :SDL_UnlockSensors => :UnlockSensors,
    :SDL_NumSensors => :NumSensors,
    :SDL_SensorGetDeviceName => :SensorGetDeviceName,
    :SDL_SensorGetDeviceType => :SensorGetDeviceType,
    :SDL_SensorGetDeviceNonPortableType => :SensorGetDeviceNonPortableType,
    :SDL_SensorGetDeviceInstanceID => :SensorGetDeviceInstanceID,
    :SDL_SensorOpen => :SensorOpen,
    :SDL_SensorFromInstanceID => :SensorFromInstanceID,
    :SDL_SensorGetName => :SensorGetName,
    :SDL_SensorGetType => :SensorGetType,
    :SDL_SensorGetNonPortableType => :SensorGetNonPortableType,
    :SDL_SensorGetInstanceID => :SensorGetInstanceID,
    :SDL_SensorGetData => :SensorGetData,
    :SDL_SensorGetDataWithTimestamp => :SensorGetDataWithTimestamp,
    :SDL_SensorClose => :SensorClose,
    :SDL_SensorUpdate => :SensorUpdate,
  }
  args = {
    :SDL_LockSensors => [],
    :SDL_UnlockSensors => [],
    :SDL_NumSensors => [],
    :SDL_SensorGetDeviceName => [:int],
    :SDL_SensorGetDeviceType => [:int],
    :SDL_SensorGetDeviceNonPortableType => [:int],
    :SDL_SensorGetDeviceInstanceID => [:int],
    :SDL_SensorOpen => [:int],
    :SDL_SensorFromInstanceID => [:int],
    :SDL_SensorGetName => [:pointer],
    :SDL_SensorGetType => [:pointer],
    :SDL_SensorGetNonPortableType => [:pointer],
    :SDL_SensorGetInstanceID => [:pointer],
    :SDL_SensorGetData => [:pointer, :pointer, :int],
    :SDL_SensorGetDataWithTimestamp => [:pointer, :pointer, :pointer, :int],
    :SDL_SensorClose => [:pointer],
    :SDL_SensorUpdate => [],
  }
  retvals = {
    :SDL_LockSensors => :void,
    :SDL_UnlockSensors => :void,
    :SDL_NumSensors => :int,
    :SDL_SensorGetDeviceName => :pointer,
    :SDL_SensorGetDeviceType => :int,
    :SDL_SensorGetDeviceNonPortableType => :int,
    :SDL_SensorGetDeviceInstanceID => :int,
    :SDL_SensorOpen => :pointer,
    :SDL_SensorFromInstanceID => :pointer,
    :SDL_SensorGetName => :pointer,
    :SDL_SensorGetType => :int,
    :SDL_SensorGetNonPortableType => :int,
    :SDL_SensorGetInstanceID => :int,
    :SDL_SensorGetData => :int,
    :SDL_SensorGetDataWithTimestamp => :int,
    :SDL_SensorClose => :void,
    :SDL_SensorUpdate => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_shape_symbols(output_error = false) ⇒ Object

Function



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/sdl2_shape.rb', line 48

def self.setup_shape_symbols(output_error = false)
  symbols = [
    :SDL_CreateShapedWindow,
    :SDL_IsShapedWindow,
    :SDL_SetWindowShape,
    :SDL_GetShapedWindowMode,
  ]
  apis = {
    :SDL_CreateShapedWindow => :CreateShapedWindow,
    :SDL_IsShapedWindow => :IsShapedWindow,
    :SDL_SetWindowShape => :SetWindowShape,
    :SDL_GetShapedWindowMode => :GetShapedWindowMode,
  }
  args = {
    :SDL_CreateShapedWindow => [:pointer, :uint, :uint, :uint, :uint, :uint],
    :SDL_IsShapedWindow => [:pointer],
    :SDL_SetWindowShape => [:pointer, :pointer, :pointer],
    :SDL_GetShapedWindowMode => [:pointer, :pointer],
  }
  retvals = {
    :SDL_CreateShapedWindow => :pointer,
    :SDL_IsShapedWindow => :int,
    :SDL_SetWindowShape => :int,
    :SDL_GetShapedWindowMode => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_sound_symbols(output_error = false) ⇒ Object

Function



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# File 'lib/sdl2_sound.rb', line 71

def self.setup_sound_symbols(output_error = false)
  symbols = [
    :Sound_GetLinkedVersion,
    :Sound_Init,
    :Sound_Quit,
    :Sound_AvailableDecoders,
    :Sound_GetError,
    :Sound_ClearError,
    :Sound_NewSample,
    :Sound_NewSampleFromMem,
    :Sound_NewSampleFromFile,
    :Sound_FreeSample,
    :Sound_GetDuration,
    :Sound_SetBufferSize,
    :Sound_Decode,
    :Sound_DecodeAll,
    :Sound_Rewind,
    :Sound_Seek,
  ]
  apis = {
    :Sound_GetLinkedVersion => :Sound_GetLinkedVersion,
    :Sound_Init => :Sound_Init,
    :Sound_Quit => :Sound_Quit,
    :Sound_AvailableDecoders => :Sound_AvailableDecoders,
    :Sound_GetError => :Sound_GetError,
    :Sound_ClearError => :Sound_ClearError,
    :Sound_NewSample => :Sound_NewSample,
    :Sound_NewSampleFromMem => :Sound_NewSampleFromMem,
    :Sound_NewSampleFromFile => :Sound_NewSampleFromFile,
    :Sound_FreeSample => :Sound_FreeSample,
    :Sound_GetDuration => :Sound_GetDuration,
    :Sound_SetBufferSize => :Sound_SetBufferSize,
    :Sound_Decode => :Sound_Decode,
    :Sound_DecodeAll => :Sound_DecodeAll,
    :Sound_Rewind => :Sound_Rewind,
    :Sound_Seek => :Sound_Seek,
  }
  args = {
    :Sound_GetLinkedVersion => [:pointer],
    :Sound_Init => [],
    :Sound_Quit => [],
    :Sound_AvailableDecoders => [],
    :Sound_GetError => [],
    :Sound_ClearError => [],
    :Sound_NewSample => [:pointer, :pointer, :pointer, :uint],
    :Sound_NewSampleFromMem => [:pointer, :uint, :pointer, :pointer, :uint],
    :Sound_NewSampleFromFile => [:pointer, :pointer, :uint],
    :Sound_FreeSample => [:pointer],
    :Sound_GetDuration => [:pointer],
    :Sound_SetBufferSize => [:pointer, :uint],
    :Sound_Decode => [:pointer],
    :Sound_DecodeAll => [:pointer],
    :Sound_Rewind => [:pointer],
    :Sound_Seek => [:pointer, :uint],
  }
  retvals = {
    :Sound_GetLinkedVersion => :void,
    :Sound_Init => :int,
    :Sound_Quit => :int,
    :Sound_AvailableDecoders => :pointer,
    :Sound_GetError => :pointer,
    :Sound_ClearError => :void,
    :Sound_NewSample => :pointer,
    :Sound_NewSampleFromMem => :pointer,
    :Sound_NewSampleFromFile => :pointer,
    :Sound_FreeSample => :void,
    :Sound_GetDuration => :int,
    :Sound_SetBufferSize => :int,
    :Sound_Decode => :uint,
    :Sound_DecodeAll => :uint,
    :Sound_Rewind => :int,
    :Sound_Seek => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_stdinc_symbols(output_error = false) ⇒ Object

Function



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
# File 'lib/sdl2_stdinc.rb', line 45

def self.setup_stdinc_symbols(output_error = false)
  symbols = [
    :SDL_malloc,
    :SDL_calloc,
    :SDL_realloc,
    :SDL_free,
    :SDL_GetOriginalMemoryFunctions,
    :SDL_GetMemoryFunctions,
    :SDL_SetMemoryFunctions,
    :SDL_GetNumAllocations,
    :SDL_getenv,
    :SDL_setenv,
    :SDL_qsort,
    :SDL_bsearch,
    :SDL_abs,
    :SDL_isalpha,
    :SDL_isalnum,
    :SDL_isblank,
    :SDL_iscntrl,
    :SDL_isdigit,
    :SDL_isxdigit,
    :SDL_ispunct,
    :SDL_isspace,
    :SDL_isupper,
    :SDL_islower,
    :SDL_isprint,
    :SDL_isgraph,
    :SDL_toupper,
    :SDL_tolower,
    :SDL_crc16,
    :SDL_crc32,
    :SDL_memset,
    :SDL_memcpy,
    :SDL_memmove,
    :SDL_memcmp,
    :SDL_wcslen,
    :SDL_wcslcpy,
    :SDL_wcslcat,
    :SDL_wcsdup,
    :SDL_wcsstr,
    :SDL_wcscmp,
    :SDL_wcsncmp,
    :SDL_wcscasecmp,
    :SDL_wcsncasecmp,
    :SDL_strlen,
    :SDL_strlcpy,
    :SDL_utf8strlcpy,
    :SDL_strlcat,
    :SDL_strdup,
    :SDL_strrev,
    :SDL_strupr,
    :SDL_strlwr,
    :SDL_strchr,
    :SDL_strrchr,
    :SDL_strstr,
    :SDL_strcasestr,
    :SDL_strtokr,
    :SDL_utf8strlen,
    :SDL_utf8strnlen,
    :SDL_itoa,
    :SDL_uitoa,
    :SDL_ltoa,
    :SDL_ultoa,
    :SDL_lltoa,
    :SDL_ulltoa,
    :SDL_atoi,
    :SDL_atof,
    :SDL_strtol,
    :SDL_strtoul,
    :SDL_strtoll,
    :SDL_strtoull,
    :SDL_strtod,
    :SDL_strcmp,
    :SDL_strncmp,
    :SDL_strcasecmp,
    :SDL_strncasecmp,
    :SDL_sscanf,
    :SDL_vsscanf,
    :SDL_snprintf,
    :SDL_vsnprintf,
    :SDL_asprintf,
    :SDL_vasprintf,
    :SDL_acos,
    :SDL_acosf,
    :SDL_asin,
    :SDL_asinf,
    :SDL_atan,
    :SDL_atanf,
    :SDL_atan2,
    :SDL_atan2f,
    :SDL_ceil,
    :SDL_ceilf,
    :SDL_copysign,
    :SDL_copysignf,
    :SDL_cos,
    :SDL_cosf,
    :SDL_exp,
    :SDL_expf,
    :SDL_fabs,
    :SDL_fabsf,
    :SDL_floor,
    :SDL_floorf,
    :SDL_trunc,
    :SDL_truncf,
    :SDL_fmod,
    :SDL_fmodf,
    :SDL_log,
    :SDL_logf,
    :SDL_log10,
    :SDL_log10f,
    :SDL_pow,
    :SDL_powf,
    :SDL_round,
    :SDL_roundf,
    :SDL_lround,
    :SDL_lroundf,
    :SDL_scalbn,
    :SDL_scalbnf,
    :SDL_sin,
    :SDL_sinf,
    :SDL_sqrt,
    :SDL_sqrtf,
    :SDL_tan,
    :SDL_tanf,
    :SDL_iconv_open,
    :SDL_iconv_close,
    :SDL_iconv,
    :SDL_iconv_string,
  ]
  apis = {
    :SDL_malloc => :malloc,
    :SDL_calloc => :calloc,
    :SDL_realloc => :realloc,
    :SDL_free => :free,
    :SDL_GetOriginalMemoryFunctions => :GetOriginalMemoryFunctions,
    :SDL_GetMemoryFunctions => :GetMemoryFunctions,
    :SDL_SetMemoryFunctions => :SetMemoryFunctions,
    :SDL_GetNumAllocations => :GetNumAllocations,
    :SDL_getenv => :getenv,
    :SDL_setenv => :setenv,
    :SDL_qsort => :qsort,
    :SDL_bsearch => :bsearch,
    :SDL_abs => :abs,
    :SDL_isalpha => :isalpha,
    :SDL_isalnum => :isalnum,
    :SDL_isblank => :isblank,
    :SDL_iscntrl => :iscntrl,
    :SDL_isdigit => :isdigit,
    :SDL_isxdigit => :isxdigit,
    :SDL_ispunct => :ispunct,
    :SDL_isspace => :isspace,
    :SDL_isupper => :isupper,
    :SDL_islower => :islower,
    :SDL_isprint => :isprint,
    :SDL_isgraph => :isgraph,
    :SDL_toupper => :toupper,
    :SDL_tolower => :tolower,
    :SDL_crc16 => :crc16,
    :SDL_crc32 => :crc32,
    :SDL_memset => :memset,
    :SDL_memcpy => :memcpy,
    :SDL_memmove => :memmove,
    :SDL_memcmp => :memcmp,
    :SDL_wcslen => :wcslen,
    :SDL_wcslcpy => :wcslcpy,
    :SDL_wcslcat => :wcslcat,
    :SDL_wcsdup => :wcsdup,
    :SDL_wcsstr => :wcsstr,
    :SDL_wcscmp => :wcscmp,
    :SDL_wcsncmp => :wcsncmp,
    :SDL_wcscasecmp => :wcscasecmp,
    :SDL_wcsncasecmp => :wcsncasecmp,
    :SDL_strlen => :strlen,
    :SDL_strlcpy => :strlcpy,
    :SDL_utf8strlcpy => :utf8strlcpy,
    :SDL_strlcat => :strlcat,
    :SDL_strdup => :strdup,
    :SDL_strrev => :strrev,
    :SDL_strupr => :strupr,
    :SDL_strlwr => :strlwr,
    :SDL_strchr => :strchr,
    :SDL_strrchr => :strrchr,
    :SDL_strstr => :strstr,
    :SDL_strcasestr => :strcasestr,
    :SDL_strtokr => :strtokr,
    :SDL_utf8strlen => :utf8strlen,
    :SDL_utf8strnlen => :utf8strnlen,
    :SDL_itoa => :itoa,
    :SDL_uitoa => :uitoa,
    :SDL_ltoa => :ltoa,
    :SDL_ultoa => :ultoa,
    :SDL_lltoa => :lltoa,
    :SDL_ulltoa => :ulltoa,
    :SDL_atoi => :atoi,
    :SDL_atof => :atof,
    :SDL_strtol => :strtol,
    :SDL_strtoul => :strtoul,
    :SDL_strtoll => :strtoll,
    :SDL_strtoull => :strtoull,
    :SDL_strtod => :strtod,
    :SDL_strcmp => :strcmp,
    :SDL_strncmp => :strncmp,
    :SDL_strcasecmp => :strcasecmp,
    :SDL_strncasecmp => :strncasecmp,
    :SDL_sscanf => :sscanf,
    :SDL_vsscanf => :vsscanf,
    :SDL_snprintf => :snprintf,
    :SDL_vsnprintf => :vsnprintf,
    :SDL_asprintf => :asprintf,
    :SDL_vasprintf => :vasprintf,
    :SDL_acos => :acos,
    :SDL_acosf => :acosf,
    :SDL_asin => :asin,
    :SDL_asinf => :asinf,
    :SDL_atan => :atan,
    :SDL_atanf => :atanf,
    :SDL_atan2 => :atan2,
    :SDL_atan2f => :atan2f,
    :SDL_ceil => :ceil,
    :SDL_ceilf => :ceilf,
    :SDL_copysign => :copysign,
    :SDL_copysignf => :copysignf,
    :SDL_cos => :cos,
    :SDL_cosf => :cosf,
    :SDL_exp => :exp,
    :SDL_expf => :expf,
    :SDL_fabs => :fabs,
    :SDL_fabsf => :fabsf,
    :SDL_floor => :floor,
    :SDL_floorf => :floorf,
    :SDL_trunc => :trunc,
    :SDL_truncf => :truncf,
    :SDL_fmod => :fmod,
    :SDL_fmodf => :fmodf,
    :SDL_log => :log,
    :SDL_logf => :logf,
    :SDL_log10 => :log10,
    :SDL_log10f => :log10f,
    :SDL_pow => :pow,
    :SDL_powf => :powf,
    :SDL_round => :round,
    :SDL_roundf => :roundf,
    :SDL_lround => :lround,
    :SDL_lroundf => :lroundf,
    :SDL_scalbn => :scalbn,
    :SDL_scalbnf => :scalbnf,
    :SDL_sin => :sin,
    :SDL_sinf => :sinf,
    :SDL_sqrt => :sqrt,
    :SDL_sqrtf => :sqrtf,
    :SDL_tan => :tan,
    :SDL_tanf => :tanf,
    :SDL_iconv_open => :iconv_open,
    :SDL_iconv_close => :iconv_close,
    :SDL_iconv => :iconv,
    :SDL_iconv_string => :iconv_string,
  }
  args = {
    :SDL_malloc => [:ulong],
    :SDL_calloc => [:ulong, :ulong],
    :SDL_realloc => [:pointer, :ulong],
    :SDL_free => [:pointer],
    :SDL_GetOriginalMemoryFunctions => [:pointer, :pointer, :pointer, :pointer],
    :SDL_GetMemoryFunctions => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SetMemoryFunctions => [:SDL_malloc_func, :SDL_calloc_func, :SDL_realloc_func, :SDL_free_func],
    :SDL_GetNumAllocations => [],
    :SDL_getenv => [:pointer],
    :SDL_setenv => [:pointer, :pointer, :int],
    :SDL_qsort => [:pointer, :ulong, :ulong, :pointer],
    :SDL_bsearch => [:pointer, :pointer, :ulong, :ulong, :pointer],
    :SDL_abs => [:int],
    :SDL_isalpha => [:int],
    :SDL_isalnum => [:int],
    :SDL_isblank => [:int],
    :SDL_iscntrl => [:int],
    :SDL_isdigit => [:int],
    :SDL_isxdigit => [:int],
    :SDL_ispunct => [:int],
    :SDL_isspace => [:int],
    :SDL_isupper => [:int],
    :SDL_islower => [:int],
    :SDL_isprint => [:int],
    :SDL_isgraph => [:int],
    :SDL_toupper => [:int],
    :SDL_tolower => [:int],
    :SDL_crc16 => [:ushort, :pointer, :ulong],
    :SDL_crc32 => [:uint, :pointer, :ulong],
    :SDL_memset => [:pointer, :int, :ulong],
    :SDL_memcpy => [:pointer, :pointer, :ulong],
    :SDL_memmove => [:pointer, :pointer, :ulong],
    :SDL_memcmp => [:pointer, :pointer, :ulong],
    :SDL_wcslen => [:pointer],
    :SDL_wcslcpy => [:pointer, :pointer, :ulong],
    :SDL_wcslcat => [:pointer, :pointer, :ulong],
    :SDL_wcsdup => [:pointer],
    :SDL_wcsstr => [:pointer, :pointer],
    :SDL_wcscmp => [:pointer, :pointer],
    :SDL_wcsncmp => [:pointer, :pointer, :ulong],
    :SDL_wcscasecmp => [:pointer, :pointer],
    :SDL_wcsncasecmp => [:pointer, :pointer, :ulong],
    :SDL_strlen => [:pointer],
    :SDL_strlcpy => [:pointer, :pointer, :ulong],
    :SDL_utf8strlcpy => [:pointer, :pointer, :ulong],
    :SDL_strlcat => [:pointer, :pointer, :ulong],
    :SDL_strdup => [:pointer],
    :SDL_strrev => [:pointer],
    :SDL_strupr => [:pointer],
    :SDL_strlwr => [:pointer],
    :SDL_strchr => [:pointer, :int],
    :SDL_strrchr => [:pointer, :int],
    :SDL_strstr => [:pointer, :pointer],
    :SDL_strcasestr => [:pointer, :pointer],
    :SDL_strtokr => [:pointer, :pointer, :pointer],
    :SDL_utf8strlen => [:pointer],
    :SDL_utf8strnlen => [:pointer, :ulong],
    :SDL_itoa => [:int, :pointer, :int],
    :SDL_uitoa => [:uint, :pointer, :int],
    :SDL_ltoa => [:long, :pointer, :int],
    :SDL_ultoa => [:ulong, :pointer, :int],
    :SDL_lltoa => [:long_long, :pointer, :int],
    :SDL_ulltoa => [:ulong_long, :pointer, :int],
    :SDL_atoi => [:pointer],
    :SDL_atof => [:pointer],
    :SDL_strtol => [:pointer, :pointer, :int],
    :SDL_strtoul => [:pointer, :pointer, :int],
    :SDL_strtoll => [:pointer, :pointer, :int],
    :SDL_strtoull => [:pointer, :pointer, :int],
    :SDL_strtod => [:pointer, :pointer],
    :SDL_strcmp => [:pointer, :pointer],
    :SDL_strncmp => [:pointer, :pointer, :ulong],
    :SDL_strcasecmp => [:pointer, :pointer],
    :SDL_strncasecmp => [:pointer, :pointer, :ulong],
    :SDL_sscanf => [:pointer, :pointer],
    :SDL_vsscanf => [:pointer, :pointer, :pointer],
    :SDL_snprintf => [:pointer, :ulong, :pointer],
    :SDL_vsnprintf => [:pointer, :ulong, :pointer, :pointer],
    :SDL_asprintf => [:pointer, :pointer],
    :SDL_vasprintf => [:pointer, :pointer, :pointer],
    :SDL_acos => [:double],
    :SDL_acosf => [:float],
    :SDL_asin => [:double],
    :SDL_asinf => [:float],
    :SDL_atan => [:double],
    :SDL_atanf => [:float],
    :SDL_atan2 => [:double, :double],
    :SDL_atan2f => [:float, :float],
    :SDL_ceil => [:double],
    :SDL_ceilf => [:float],
    :SDL_copysign => [:double, :double],
    :SDL_copysignf => [:float, :float],
    :SDL_cos => [:double],
    :SDL_cosf => [:float],
    :SDL_exp => [:double],
    :SDL_expf => [:float],
    :SDL_fabs => [:double],
    :SDL_fabsf => [:float],
    :SDL_floor => [:double],
    :SDL_floorf => [:float],
    :SDL_trunc => [:double],
    :SDL_truncf => [:float],
    :SDL_fmod => [:double, :double],
    :SDL_fmodf => [:float, :float],
    :SDL_log => [:double],
    :SDL_logf => [:float],
    :SDL_log10 => [:double],
    :SDL_log10f => [:float],
    :SDL_pow => [:double, :double],
    :SDL_powf => [:float, :float],
    :SDL_round => [:double],
    :SDL_roundf => [:float],
    :SDL_lround => [:double],
    :SDL_lroundf => [:float],
    :SDL_scalbn => [:double, :int],
    :SDL_scalbnf => [:float, :int],
    :SDL_sin => [:double],
    :SDL_sinf => [:float],
    :SDL_sqrt => [:double],
    :SDL_sqrtf => [:float],
    :SDL_tan => [:double],
    :SDL_tanf => [:float],
    :SDL_iconv_open => [:pointer, :pointer],
    :SDL_iconv_close => [:pointer],
    :SDL_iconv => [:pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_iconv_string => [:pointer, :pointer, :pointer, :ulong],
  }
  retvals = {
    :SDL_malloc => :pointer,
    :SDL_calloc => :pointer,
    :SDL_realloc => :pointer,
    :SDL_free => :void,
    :SDL_GetOriginalMemoryFunctions => :void,
    :SDL_GetMemoryFunctions => :void,
    :SDL_SetMemoryFunctions => :int,
    :SDL_GetNumAllocations => :int,
    :SDL_getenv => :pointer,
    :SDL_setenv => :int,
    :SDL_qsort => :void,
    :SDL_bsearch => :pointer,
    :SDL_abs => :int,
    :SDL_isalpha => :int,
    :SDL_isalnum => :int,
    :SDL_isblank => :int,
    :SDL_iscntrl => :int,
    :SDL_isdigit => :int,
    :SDL_isxdigit => :int,
    :SDL_ispunct => :int,
    :SDL_isspace => :int,
    :SDL_isupper => :int,
    :SDL_islower => :int,
    :SDL_isprint => :int,
    :SDL_isgraph => :int,
    :SDL_toupper => :int,
    :SDL_tolower => :int,
    :SDL_crc16 => :ushort,
    :SDL_crc32 => :uint,
    :SDL_memset => :pointer,
    :SDL_memcpy => :pointer,
    :SDL_memmove => :pointer,
    :SDL_memcmp => :int,
    :SDL_wcslen => :ulong,
    :SDL_wcslcpy => :ulong,
    :SDL_wcslcat => :ulong,
    :SDL_wcsdup => :pointer,
    :SDL_wcsstr => :pointer,
    :SDL_wcscmp => :int,
    :SDL_wcsncmp => :int,
    :SDL_wcscasecmp => :int,
    :SDL_wcsncasecmp => :int,
    :SDL_strlen => :ulong,
    :SDL_strlcpy => :ulong,
    :SDL_utf8strlcpy => :ulong,
    :SDL_strlcat => :ulong,
    :SDL_strdup => :pointer,
    :SDL_strrev => :pointer,
    :SDL_strupr => :pointer,
    :SDL_strlwr => :pointer,
    :SDL_strchr => :pointer,
    :SDL_strrchr => :pointer,
    :SDL_strstr => :pointer,
    :SDL_strcasestr => :pointer,
    :SDL_strtokr => :pointer,
    :SDL_utf8strlen => :ulong,
    :SDL_utf8strnlen => :ulong,
    :SDL_itoa => :pointer,
    :SDL_uitoa => :pointer,
    :SDL_ltoa => :pointer,
    :SDL_ultoa => :pointer,
    :SDL_lltoa => :pointer,
    :SDL_ulltoa => :pointer,
    :SDL_atoi => :int,
    :SDL_atof => :double,
    :SDL_strtol => :long,
    :SDL_strtoul => :ulong,
    :SDL_strtoll => :long_long,
    :SDL_strtoull => :ulong_long,
    :SDL_strtod => :double,
    :SDL_strcmp => :int,
    :SDL_strncmp => :int,
    :SDL_strcasecmp => :int,
    :SDL_strncasecmp => :int,
    :SDL_sscanf => :int,
    :SDL_vsscanf => :int,
    :SDL_snprintf => :int,
    :SDL_vsnprintf => :int,
    :SDL_asprintf => :int,
    :SDL_vasprintf => :int,
    :SDL_acos => :double,
    :SDL_acosf => :float,
    :SDL_asin => :double,
    :SDL_asinf => :float,
    :SDL_atan => :double,
    :SDL_atanf => :float,
    :SDL_atan2 => :double,
    :SDL_atan2f => :float,
    :SDL_ceil => :double,
    :SDL_ceilf => :float,
    :SDL_copysign => :double,
    :SDL_copysignf => :float,
    :SDL_cos => :double,
    :SDL_cosf => :float,
    :SDL_exp => :double,
    :SDL_expf => :float,
    :SDL_fabs => :double,
    :SDL_fabsf => :float,
    :SDL_floor => :double,
    :SDL_floorf => :float,
    :SDL_trunc => :double,
    :SDL_truncf => :float,
    :SDL_fmod => :double,
    :SDL_fmodf => :float,
    :SDL_log => :double,
    :SDL_logf => :float,
    :SDL_log10 => :double,
    :SDL_log10f => :float,
    :SDL_pow => :double,
    :SDL_powf => :float,
    :SDL_round => :double,
    :SDL_roundf => :float,
    :SDL_lround => :long,
    :SDL_lroundf => :long,
    :SDL_scalbn => :double,
    :SDL_scalbnf => :float,
    :SDL_sin => :double,
    :SDL_sinf => :float,
    :SDL_sqrt => :double,
    :SDL_sqrtf => :float,
    :SDL_tan => :double,
    :SDL_tanf => :float,
    :SDL_iconv_open => :pointer,
    :SDL_iconv_close => :int,
    :SDL_iconv => :ulong,
    :SDL_iconv_string => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_surface_symbols(output_error = false) ⇒ Object

Function



54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/sdl2_surface.rb', line 54

def self.setup_surface_symbols(output_error = false)
  symbols = [
    :SDL_CreateRGBSurface,
    :SDL_CreateRGBSurfaceWithFormat,
    :SDL_CreateRGBSurfaceFrom,
    :SDL_CreateRGBSurfaceWithFormatFrom,
    :SDL_FreeSurface,
    :SDL_SetSurfacePalette,
    :SDL_LockSurface,
    :SDL_UnlockSurface,
    :SDL_LoadBMP_RW,
    :SDL_SaveBMP_RW,
    :SDL_SetSurfaceRLE,
    :SDL_HasSurfaceRLE,
    :SDL_SetColorKey,
    :SDL_HasColorKey,
    :SDL_GetColorKey,
    :SDL_SetSurfaceColorMod,
    :SDL_GetSurfaceColorMod,
    :SDL_SetSurfaceAlphaMod,
    :SDL_GetSurfaceAlphaMod,
    :SDL_SetSurfaceBlendMode,
    :SDL_GetSurfaceBlendMode,
    :SDL_SetClipRect,
    :SDL_GetClipRect,
    :SDL_DuplicateSurface,
    :SDL_ConvertSurface,
    :SDL_ConvertSurfaceFormat,
    :SDL_ConvertPixels,
    :SDL_PremultiplyAlpha,
    :SDL_FillRect,
    :SDL_FillRects,
    :SDL_UpperBlit,
    :SDL_LowerBlit,
    :SDL_SoftStretch,
    :SDL_SoftStretchLinear,
    :SDL_UpperBlitScaled,
    :SDL_LowerBlitScaled,
    :SDL_SetYUVConversionMode,
    :SDL_GetYUVConversionMode,
    :SDL_GetYUVConversionModeForResolution,
  ]
  apis = {
    :SDL_CreateRGBSurface => :CreateRGBSurface,
    :SDL_CreateRGBSurfaceWithFormat => :CreateRGBSurfaceWithFormat,
    :SDL_CreateRGBSurfaceFrom => :CreateRGBSurfaceFrom,
    :SDL_CreateRGBSurfaceWithFormatFrom => :CreateRGBSurfaceWithFormatFrom,
    :SDL_FreeSurface => :FreeSurface,
    :SDL_SetSurfacePalette => :SetSurfacePalette,
    :SDL_LockSurface => :LockSurface,
    :SDL_UnlockSurface => :UnlockSurface,
    :SDL_LoadBMP_RW => :LoadBMP_RW,
    :SDL_SaveBMP_RW => :SaveBMP_RW,
    :SDL_SetSurfaceRLE => :SetSurfaceRLE,
    :SDL_HasSurfaceRLE => :HasSurfaceRLE,
    :SDL_SetColorKey => :SetColorKey,
    :SDL_HasColorKey => :HasColorKey,
    :SDL_GetColorKey => :GetColorKey,
    :SDL_SetSurfaceColorMod => :SetSurfaceColorMod,
    :SDL_GetSurfaceColorMod => :GetSurfaceColorMod,
    :SDL_SetSurfaceAlphaMod => :SetSurfaceAlphaMod,
    :SDL_GetSurfaceAlphaMod => :GetSurfaceAlphaMod,
    :SDL_SetSurfaceBlendMode => :SetSurfaceBlendMode,
    :SDL_GetSurfaceBlendMode => :GetSurfaceBlendMode,
    :SDL_SetClipRect => :SetClipRect,
    :SDL_GetClipRect => :GetClipRect,
    :SDL_DuplicateSurface => :DuplicateSurface,
    :SDL_ConvertSurface => :ConvertSurface,
    :SDL_ConvertSurfaceFormat => :ConvertSurfaceFormat,
    :SDL_ConvertPixels => :ConvertPixels,
    :SDL_PremultiplyAlpha => :PremultiplyAlpha,
    :SDL_FillRect => :FillRect,
    :SDL_FillRects => :FillRects,
    :SDL_UpperBlit => :UpperBlit,
    :SDL_LowerBlit => :LowerBlit,
    :SDL_SoftStretch => :SoftStretch,
    :SDL_SoftStretchLinear => :SoftStretchLinear,
    :SDL_UpperBlitScaled => :UpperBlitScaled,
    :SDL_LowerBlitScaled => :LowerBlitScaled,
    :SDL_SetYUVConversionMode => :SetYUVConversionMode,
    :SDL_GetYUVConversionMode => :GetYUVConversionMode,
    :SDL_GetYUVConversionModeForResolution => :GetYUVConversionModeForResolution,
  }
  args = {
    :SDL_CreateRGBSurface => [:uint, :int, :int, :int, :uint, :uint, :uint, :uint],
    :SDL_CreateRGBSurfaceWithFormat => [:uint, :int, :int, :int, :uint],
    :SDL_CreateRGBSurfaceFrom => [:pointer, :int, :int, :int, :int, :uint, :uint, :uint, :uint],
    :SDL_CreateRGBSurfaceWithFormatFrom => [:pointer, :int, :int, :int, :int, :uint],
    :SDL_FreeSurface => [:pointer],
    :SDL_SetSurfacePalette => [:pointer, :pointer],
    :SDL_LockSurface => [:pointer],
    :SDL_UnlockSurface => [:pointer],
    :SDL_LoadBMP_RW => [:pointer, :int],
    :SDL_SaveBMP_RW => [:pointer, :pointer, :int],
    :SDL_SetSurfaceRLE => [:pointer, :int],
    :SDL_HasSurfaceRLE => [:pointer],
    :SDL_SetColorKey => [:pointer, :int, :uint],
    :SDL_HasColorKey => [:pointer],
    :SDL_GetColorKey => [:pointer, :pointer],
    :SDL_SetSurfaceColorMod => [:pointer, :uchar, :uchar, :uchar],
    :SDL_GetSurfaceColorMod => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SetSurfaceAlphaMod => [:pointer, :uchar],
    :SDL_GetSurfaceAlphaMod => [:pointer, :pointer],
    :SDL_SetSurfaceBlendMode => [:pointer, :int],
    :SDL_GetSurfaceBlendMode => [:pointer, :pointer],
    :SDL_SetClipRect => [:pointer, :pointer],
    :SDL_GetClipRect => [:pointer, :pointer],
    :SDL_DuplicateSurface => [:pointer],
    :SDL_ConvertSurface => [:pointer, :pointer, :uint],
    :SDL_ConvertSurfaceFormat => [:pointer, :uint, :uint],
    :SDL_ConvertPixels => [:int, :int, :uint, :pointer, :int, :uint, :pointer, :int],
    :SDL_PremultiplyAlpha => [:int, :int, :uint, :pointer, :int, :uint, :pointer, :int],
    :SDL_FillRect => [:pointer, :pointer, :uint],
    :SDL_FillRects => [:pointer, :pointer, :int, :uint],
    :SDL_UpperBlit => [:pointer, :pointer, :pointer, :pointer],
    :SDL_LowerBlit => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SoftStretch => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SoftStretchLinear => [:pointer, :pointer, :pointer, :pointer],
    :SDL_UpperBlitScaled => [:pointer, :pointer, :pointer, :pointer],
    :SDL_LowerBlitScaled => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SetYUVConversionMode => [:int],
    :SDL_GetYUVConversionMode => [],
    :SDL_GetYUVConversionModeForResolution => [:int, :int],
  }
  retvals = {
    :SDL_CreateRGBSurface => :pointer,
    :SDL_CreateRGBSurfaceWithFormat => :pointer,
    :SDL_CreateRGBSurfaceFrom => :pointer,
    :SDL_CreateRGBSurfaceWithFormatFrom => :pointer,
    :SDL_FreeSurface => :void,
    :SDL_SetSurfacePalette => :int,
    :SDL_LockSurface => :int,
    :SDL_UnlockSurface => :void,
    :SDL_LoadBMP_RW => :pointer,
    :SDL_SaveBMP_RW => :int,
    :SDL_SetSurfaceRLE => :int,
    :SDL_HasSurfaceRLE => :int,
    :SDL_SetColorKey => :int,
    :SDL_HasColorKey => :int,
    :SDL_GetColorKey => :int,
    :SDL_SetSurfaceColorMod => :int,
    :SDL_GetSurfaceColorMod => :int,
    :SDL_SetSurfaceAlphaMod => :int,
    :SDL_GetSurfaceAlphaMod => :int,
    :SDL_SetSurfaceBlendMode => :int,
    :SDL_GetSurfaceBlendMode => :int,
    :SDL_SetClipRect => :int,
    :SDL_GetClipRect => :void,
    :SDL_DuplicateSurface => :pointer,
    :SDL_ConvertSurface => :pointer,
    :SDL_ConvertSurfaceFormat => :pointer,
    :SDL_ConvertPixels => :int,
    :SDL_PremultiplyAlpha => :int,
    :SDL_FillRect => :int,
    :SDL_FillRects => :int,
    :SDL_UpperBlit => :int,
    :SDL_LowerBlit => :int,
    :SDL_SoftStretch => :int,
    :SDL_SoftStretchLinear => :int,
    :SDL_UpperBlitScaled => :int,
    :SDL_LowerBlitScaled => :int,
    :SDL_SetYUVConversionMode => :void,
    :SDL_GetYUVConversionMode => :int,
    :SDL_GetYUVConversionModeForResolution => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_symbols(output_error = false) ⇒ Object



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# File 'lib/sdl2.rb', line 92

def self.setup_symbols(output_error = false)
  setup_main_symbols(output_error)
  setup_audio_symbols(output_error)
  setup_blendmode_symbols(output_error)
  setup_clipboard_symbols(output_error)
  setup_cpuinfo_symbols(output_error)
  setup_error_symbols(output_error)
  setup_events_symbols(output_error)
  setup_filesystem_symbols(output_error)
  setup_gamecontroller_symbols(output_error)
  setup_gesture_symbols(output_error)
  setup_haptic_symbols(output_error)
  setup_hints_symbols(output_error)
  setup_joystick_symbols(output_error)
  setup_keyboard_symbols(output_error)
  setup_keycode_symbols(output_error)
  setup_log_symbols(output_error)
  setup_messagebox_symbols(output_error)
  setup_misc_symbols(output_error)
  setup_mouse_symbols(output_error)
  setup_pixels_symbols(output_error)
  setup_platform_symbols(output_error)
  setup_power_symbols(output_error)
  setup_rect_symbols(output_error)
  setup_render_symbols(output_error)
  setup_rwops_symbols(output_error)
  setup_scancode_symbols(output_error)
  setup_sensor_symbols(output_error)
  setup_shape_symbols(output_error)
  setup_surface_symbols(output_error)
  setup_syswm_symbols(output_error)
  setup_stdinc_symbols(output_error)
  setup_timer_symbols(output_error)
  setup_touch_symbols(output_error)
  setup_version_symbols(output_error)
  setup_video_symbols(output_error)
  setup_vulkan_symbols(output_error)
end

.setup_syswm_symbols(output_error = false) ⇒ Object

Function



211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# File 'lib/sdl2_syswm.rb', line 211

def self.setup_syswm_symbols(output_error = false)
  symbols = [
    :SDL_GetWindowWMInfo,
  ]
  apis = {
    :SDL_GetWindowWMInfo => :GetWindowWMInfo,
  }
  args = {
    :SDL_GetWindowWMInfo => [:pointer, :pointer],
  }
  retvals = {
    :SDL_GetWindowWMInfo => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_timer_symbols(output_error = false) ⇒ Object

Function



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/sdl2_timer.rb', line 27

def self.setup_timer_symbols(output_error = false)
  symbols = [
    :SDL_GetTicks,
    :SDL_GetTicks64,
    :SDL_GetPerformanceCounter,
    :SDL_GetPerformanceFrequency,
    :SDL_Delay,
    :SDL_AddTimer,
    :SDL_RemoveTimer,
  ]
  apis = {
    :SDL_GetTicks => :GetTicks,
    :SDL_GetTicks64 => :GetTicks64,
    :SDL_GetPerformanceCounter => :GetPerformanceCounter,
    :SDL_GetPerformanceFrequency => :GetPerformanceFrequency,
    :SDL_Delay => :Delay,
    :SDL_AddTimer => :AddTimer,
    :SDL_RemoveTimer => :RemoveTimer,
  }
  args = {
    :SDL_GetTicks => [],
    :SDL_GetTicks64 => [],
    :SDL_GetPerformanceCounter => [],
    :SDL_GetPerformanceFrequency => [],
    :SDL_Delay => [:uint],
    :SDL_AddTimer => [:uint, :SDL_TimerCallback, :pointer],
    :SDL_RemoveTimer => [:int],
  }
  retvals = {
    :SDL_GetTicks => :uint,
    :SDL_GetTicks64 => :ulong_long,
    :SDL_GetPerformanceCounter => :ulong_long,
    :SDL_GetPerformanceFrequency => :ulong_long,
    :SDL_Delay => :void,
    :SDL_AddTimer => :int,
    :SDL_RemoveTimer => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_touch_symbols(output_error = false) ⇒ Object

Function



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/sdl2_touch.rb', line 43

def self.setup_touch_symbols(output_error = false)
  symbols = [
    :SDL_GetNumTouchDevices,
    :SDL_GetTouchDevice,
    :SDL_GetTouchName,
    :SDL_GetTouchDeviceType,
    :SDL_GetNumTouchFingers,
    :SDL_GetTouchFinger,
  ]
  apis = {
    :SDL_GetNumTouchDevices => :GetNumTouchDevices,
    :SDL_GetTouchDevice => :GetTouchDevice,
    :SDL_GetTouchName => :GetTouchName,
    :SDL_GetTouchDeviceType => :GetTouchDeviceType,
    :SDL_GetNumTouchFingers => :GetNumTouchFingers,
    :SDL_GetTouchFinger => :GetTouchFinger,
  }
  args = {
    :SDL_GetNumTouchDevices => [],
    :SDL_GetTouchDevice => [:int],
    :SDL_GetTouchName => [:int],
    :SDL_GetTouchDeviceType => [:long_long],
    :SDL_GetNumTouchFingers => [:long_long],
    :SDL_GetTouchFinger => [:long_long, :int],
  }
  retvals = {
    :SDL_GetNumTouchDevices => :int,
    :SDL_GetTouchDevice => :long_long,
    :SDL_GetTouchName => :pointer,
    :SDL_GetTouchDeviceType => :int,
    :SDL_GetNumTouchFingers => :int,
    :SDL_GetTouchFinger => :pointer,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_ttf_symbols(output_error = false) ⇒ Object

Function



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/sdl2_ttf.rb', line 47

def self.setup_ttf_symbols(output_error = false)
  symbols = [
    :TTF_Linked_Version,
    :TTF_GetFreeTypeVersion,
    :TTF_GetHarfBuzzVersion,
    :TTF_ByteSwappedUNICODE,
    :TTF_Init,
    :TTF_OpenFont,
    :TTF_OpenFontIndex,
    :TTF_OpenFontRW,
    :TTF_OpenFontIndexRW,
    :TTF_OpenFontDPI,
    :TTF_OpenFontIndexDPI,
    :TTF_OpenFontDPIRW,
    :TTF_OpenFontIndexDPIRW,
    :TTF_SetFontSize,
    :TTF_SetFontSizeDPI,
    :TTF_GetFontStyle,
    :TTF_SetFontStyle,
    :TTF_GetFontOutline,
    :TTF_SetFontOutline,
    :TTF_GetFontHinting,
    :TTF_SetFontHinting,
    :TTF_GetFontWrappedAlign,
    :TTF_SetFontWrappedAlign,
    :TTF_FontHeight,
    :TTF_FontAscent,
    :TTF_FontDescent,
    :TTF_FontLineSkip,
    :TTF_GetFontKerning,
    :TTF_SetFontKerning,
    :TTF_FontFaces,
    :TTF_FontFaceIsFixedWidth,
    :TTF_FontFaceFamilyName,
    :TTF_FontFaceStyleName,
    :TTF_GlyphIsProvided,
    :TTF_GlyphIsProvided32,
    :TTF_GlyphMetrics,
    :TTF_GlyphMetrics32,
    :TTF_SizeText,
    :TTF_SizeUTF8,
    :TTF_SizeUNICODE,
    :TTF_MeasureText,
    :TTF_MeasureUTF8,
    :TTF_MeasureUNICODE,
    :TTF_RenderText_Solid,
    :TTF_RenderUTF8_Solid,
    :TTF_RenderUNICODE_Solid,
    :TTF_RenderText_Solid_Wrapped,
    :TTF_RenderUTF8_Solid_Wrapped,
    :TTF_RenderUNICODE_Solid_Wrapped,
    :TTF_RenderGlyph_Solid,
    :TTF_RenderGlyph32_Solid,
    :TTF_RenderText_Shaded,
    :TTF_RenderUTF8_Shaded,
    :TTF_RenderUNICODE_Shaded,
    :TTF_RenderText_Shaded_Wrapped,
    :TTF_RenderUTF8_Shaded_Wrapped,
    :TTF_RenderUNICODE_Shaded_Wrapped,
    :TTF_RenderGlyph_Shaded,
    :TTF_RenderGlyph32_Shaded,
    :TTF_RenderText_Blended,
    :TTF_RenderUTF8_Blended,
    :TTF_RenderUNICODE_Blended,
    :TTF_RenderText_Blended_Wrapped,
    :TTF_RenderUTF8_Blended_Wrapped,
    :TTF_RenderUNICODE_Blended_Wrapped,
    :TTF_RenderGlyph_Blended,
    :TTF_RenderGlyph32_Blended,
    :TTF_RenderText_LCD,
    :TTF_RenderUTF8_LCD,
    :TTF_RenderUNICODE_LCD,
    :TTF_RenderText_LCD_Wrapped,
    :TTF_RenderUTF8_LCD_Wrapped,
    :TTF_RenderUNICODE_LCD_Wrapped,
    :TTF_RenderGlyph_LCD,
    :TTF_RenderGlyph32_LCD,
    :TTF_CloseFont,
    :TTF_Quit,
    :TTF_WasInit,
    :TTF_GetFontKerningSize,
    :TTF_GetFontKerningSizeGlyphs,
    :TTF_GetFontKerningSizeGlyphs32,
    :TTF_SetFontSDF,
    :TTF_GetFontSDF,
    :TTF_SetDirection,
    :TTF_SetScript,
    :TTF_SetFontDirection,
    :TTF_SetFontScriptName,
  ]
  apis = {
    :TTF_Linked_Version => :TTF_Linked_Version,
    :TTF_GetFreeTypeVersion => :TTF_GetFreeTypeVersion,
    :TTF_GetHarfBuzzVersion => :TTF_GetHarfBuzzVersion,
    :TTF_ByteSwappedUNICODE => :TTF_ByteSwappedUNICODE,
    :TTF_Init => :TTF_Init,
    :TTF_OpenFont => :TTF_OpenFont,
    :TTF_OpenFontIndex => :TTF_OpenFontIndex,
    :TTF_OpenFontRW => :TTF_OpenFontRW,
    :TTF_OpenFontIndexRW => :TTF_OpenFontIndexRW,
    :TTF_OpenFontDPI => :TTF_OpenFontDPI,
    :TTF_OpenFontIndexDPI => :TTF_OpenFontIndexDPI,
    :TTF_OpenFontDPIRW => :TTF_OpenFontDPIRW,
    :TTF_OpenFontIndexDPIRW => :TTF_OpenFontIndexDPIRW,
    :TTF_SetFontSize => :TTF_SetFontSize,
    :TTF_SetFontSizeDPI => :TTF_SetFontSizeDPI,
    :TTF_GetFontStyle => :TTF_GetFontStyle,
    :TTF_SetFontStyle => :TTF_SetFontStyle,
    :TTF_GetFontOutline => :TTF_GetFontOutline,
    :TTF_SetFontOutline => :TTF_SetFontOutline,
    :TTF_GetFontHinting => :TTF_GetFontHinting,
    :TTF_SetFontHinting => :TTF_SetFontHinting,
    :TTF_GetFontWrappedAlign => :TTF_GetFontWrappedAlign,
    :TTF_SetFontWrappedAlign => :TTF_SetFontWrappedAlign,
    :TTF_FontHeight => :TTF_FontHeight,
    :TTF_FontAscent => :TTF_FontAscent,
    :TTF_FontDescent => :TTF_FontDescent,
    :TTF_FontLineSkip => :TTF_FontLineSkip,
    :TTF_GetFontKerning => :TTF_GetFontKerning,
    :TTF_SetFontKerning => :TTF_SetFontKerning,
    :TTF_FontFaces => :TTF_FontFaces,
    :TTF_FontFaceIsFixedWidth => :TTF_FontFaceIsFixedWidth,
    :TTF_FontFaceFamilyName => :TTF_FontFaceFamilyName,
    :TTF_FontFaceStyleName => :TTF_FontFaceStyleName,
    :TTF_GlyphIsProvided => :TTF_GlyphIsProvided,
    :TTF_GlyphIsProvided32 => :TTF_GlyphIsProvided32,
    :TTF_GlyphMetrics => :TTF_GlyphMetrics,
    :TTF_GlyphMetrics32 => :TTF_GlyphMetrics32,
    :TTF_SizeText => :TTF_SizeText,
    :TTF_SizeUTF8 => :TTF_SizeUTF8,
    :TTF_SizeUNICODE => :TTF_SizeUNICODE,
    :TTF_MeasureText => :TTF_MeasureText,
    :TTF_MeasureUTF8 => :TTF_MeasureUTF8,
    :TTF_MeasureUNICODE => :TTF_MeasureUNICODE,
    :TTF_RenderText_Solid => :TTF_RenderText_Solid,
    :TTF_RenderUTF8_Solid => :TTF_RenderUTF8_Solid,
    :TTF_RenderUNICODE_Solid => :TTF_RenderUNICODE_Solid,
    :TTF_RenderText_Solid_Wrapped => :TTF_RenderText_Solid_Wrapped,
    :TTF_RenderUTF8_Solid_Wrapped => :TTF_RenderUTF8_Solid_Wrapped,
    :TTF_RenderUNICODE_Solid_Wrapped => :TTF_RenderUNICODE_Solid_Wrapped,
    :TTF_RenderGlyph_Solid => :TTF_RenderGlyph_Solid,
    :TTF_RenderGlyph32_Solid => :TTF_RenderGlyph32_Solid,
    :TTF_RenderText_Shaded => :TTF_RenderText_Shaded,
    :TTF_RenderUTF8_Shaded => :TTF_RenderUTF8_Shaded,
    :TTF_RenderUNICODE_Shaded => :TTF_RenderUNICODE_Shaded,
    :TTF_RenderText_Shaded_Wrapped => :TTF_RenderText_Shaded_Wrapped,
    :TTF_RenderUTF8_Shaded_Wrapped => :TTF_RenderUTF8_Shaded_Wrapped,
    :TTF_RenderUNICODE_Shaded_Wrapped => :TTF_RenderUNICODE_Shaded_Wrapped,
    :TTF_RenderGlyph_Shaded => :TTF_RenderGlyph_Shaded,
    :TTF_RenderGlyph32_Shaded => :TTF_RenderGlyph32_Shaded,
    :TTF_RenderText_Blended => :TTF_RenderText_Blended,
    :TTF_RenderUTF8_Blended => :TTF_RenderUTF8_Blended,
    :TTF_RenderUNICODE_Blended => :TTF_RenderUNICODE_Blended,
    :TTF_RenderText_Blended_Wrapped => :TTF_RenderText_Blended_Wrapped,
    :TTF_RenderUTF8_Blended_Wrapped => :TTF_RenderUTF8_Blended_Wrapped,
    :TTF_RenderUNICODE_Blended_Wrapped => :TTF_RenderUNICODE_Blended_Wrapped,
    :TTF_RenderGlyph_Blended => :TTF_RenderGlyph_Blended,
    :TTF_RenderGlyph32_Blended => :TTF_RenderGlyph32_Blended,
    :TTF_RenderText_LCD => :TTF_RenderText_LCD,
    :TTF_RenderUTF8_LCD => :TTF_RenderUTF8_LCD,
    :TTF_RenderUNICODE_LCD => :TTF_RenderUNICODE_LCD,
    :TTF_RenderText_LCD_Wrapped => :TTF_RenderText_LCD_Wrapped,
    :TTF_RenderUTF8_LCD_Wrapped => :TTF_RenderUTF8_LCD_Wrapped,
    :TTF_RenderUNICODE_LCD_Wrapped => :TTF_RenderUNICODE_LCD_Wrapped,
    :TTF_RenderGlyph_LCD => :TTF_RenderGlyph_LCD,
    :TTF_RenderGlyph32_LCD => :TTF_RenderGlyph32_LCD,
    :TTF_CloseFont => :TTF_CloseFont,
    :TTF_Quit => :TTF_Quit,
    :TTF_WasInit => :TTF_WasInit,
    :TTF_GetFontKerningSize => :TTF_GetFontKerningSize,
    :TTF_GetFontKerningSizeGlyphs => :TTF_GetFontKerningSizeGlyphs,
    :TTF_GetFontKerningSizeGlyphs32 => :TTF_GetFontKerningSizeGlyphs32,
    :TTF_SetFontSDF => :TTF_SetFontSDF,
    :TTF_GetFontSDF => :TTF_GetFontSDF,
    :TTF_SetDirection => :TTF_SetDirection,
    :TTF_SetScript => :TTF_SetScript,
    :TTF_SetFontDirection => :TTF_SetFontDirection,
    :TTF_SetFontScriptName => :TTF_SetFontScriptName,
  }
  args = {
    :TTF_Linked_Version => [],
    :TTF_GetFreeTypeVersion => [:pointer, :pointer, :pointer],
    :TTF_GetHarfBuzzVersion => [:pointer, :pointer, :pointer],
    :TTF_ByteSwappedUNICODE => [:int],
    :TTF_Init => [],
    :TTF_OpenFont => [:pointer, :int],
    :TTF_OpenFontIndex => [:pointer, :int, :long],
    :TTF_OpenFontRW => [:pointer, :int, :int],
    :TTF_OpenFontIndexRW => [:pointer, :int, :int, :long],
    :TTF_OpenFontDPI => [:pointer, :int, :uint, :uint],
    :TTF_OpenFontIndexDPI => [:pointer, :int, :long, :uint, :uint],
    :TTF_OpenFontDPIRW => [:pointer, :int, :int, :uint, :uint],
    :TTF_OpenFontIndexDPIRW => [:pointer, :int, :int, :long, :uint, :uint],
    :TTF_SetFontSize => [:pointer, :int],
    :TTF_SetFontSizeDPI => [:pointer, :int, :uint, :uint],
    :TTF_GetFontStyle => [:pointer],
    :TTF_SetFontStyle => [:pointer, :int],
    :TTF_GetFontOutline => [:pointer],
    :TTF_SetFontOutline => [:pointer, :int],
    :TTF_GetFontHinting => [:pointer],
    :TTF_SetFontHinting => [:pointer, :int],
    :TTF_GetFontWrappedAlign => [:pointer],
    :TTF_SetFontWrappedAlign => [:pointer, :int],
    :TTF_FontHeight => [:pointer],
    :TTF_FontAscent => [:pointer],
    :TTF_FontDescent => [:pointer],
    :TTF_FontLineSkip => [:pointer],
    :TTF_GetFontKerning => [:pointer],
    :TTF_SetFontKerning => [:pointer, :int],
    :TTF_FontFaces => [:pointer],
    :TTF_FontFaceIsFixedWidth => [:pointer],
    :TTF_FontFaceFamilyName => [:pointer],
    :TTF_FontFaceStyleName => [:pointer],
    :TTF_GlyphIsProvided => [:pointer, :ushort],
    :TTF_GlyphIsProvided32 => [:pointer, :uint],
    :TTF_GlyphMetrics => [:pointer, :ushort, :pointer, :pointer, :pointer, :pointer, :pointer],
    :TTF_GlyphMetrics32 => [:pointer, :uint, :pointer, :pointer, :pointer, :pointer, :pointer],
    :TTF_SizeText => [:pointer, :pointer, :pointer, :pointer],
    :TTF_SizeUTF8 => [:pointer, :pointer, :pointer, :pointer],
    :TTF_SizeUNICODE => [:pointer, :pointer, :pointer, :pointer],
    :TTF_MeasureText => [:pointer, :pointer, :int, :pointer, :pointer],
    :TTF_MeasureUTF8 => [:pointer, :pointer, :int, :pointer, :pointer],
    :TTF_MeasureUNICODE => [:pointer, :pointer, :int, :pointer, :pointer],
    :TTF_RenderText_Solid => [:pointer, :pointer, Color.by_value],
    :TTF_RenderUTF8_Solid => [:pointer, :pointer, Color.by_value],
    :TTF_RenderUNICODE_Solid => [:pointer, :pointer, Color.by_value],
    :TTF_RenderText_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
    :TTF_RenderUTF8_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
    :TTF_RenderUNICODE_Solid_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
    :TTF_RenderGlyph_Solid => [:pointer, :ushort, Color.by_value],
    :TTF_RenderGlyph32_Solid => [:pointer, :uint, Color.by_value],
    :TTF_RenderText_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
    :TTF_RenderUTF8_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
    :TTF_RenderUNICODE_Shaded => [:pointer, :pointer, Color.by_value, Color.by_value],
    :TTF_RenderText_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
    :TTF_RenderUTF8_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
    :TTF_RenderUNICODE_Shaded_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
    :TTF_RenderGlyph_Shaded => [:pointer, :ushort, Color.by_value, Color.by_value],
    :TTF_RenderGlyph32_Shaded => [:pointer, :uint, Color.by_value, Color.by_value],
    :TTF_RenderText_Blended => [:pointer, :pointer, Color.by_value],
    :TTF_RenderUTF8_Blended => [:pointer, :pointer, Color.by_value],
    :TTF_RenderUNICODE_Blended => [:pointer, :pointer, Color.by_value],
    :TTF_RenderText_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
    :TTF_RenderUTF8_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
    :TTF_RenderUNICODE_Blended_Wrapped => [:pointer, :pointer, Color.by_value, :uint],
    :TTF_RenderGlyph_Blended => [:pointer, :ushort, Color.by_value],
    :TTF_RenderGlyph32_Blended => [:pointer, :uint, Color.by_value],
    :TTF_RenderText_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
    :TTF_RenderUTF8_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
    :TTF_RenderUNICODE_LCD => [:pointer, :pointer, Color.by_value, Color.by_value],
    :TTF_RenderText_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
    :TTF_RenderUTF8_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
    :TTF_RenderUNICODE_LCD_Wrapped => [:pointer, :pointer, Color.by_value, Color.by_value, :uint],
    :TTF_RenderGlyph_LCD => [:pointer, :ushort, Color.by_value, Color.by_value],
    :TTF_RenderGlyph32_LCD => [:pointer, :uint, Color.by_value, Color.by_value],
    :TTF_CloseFont => [:pointer],
    :TTF_Quit => [],
    :TTF_WasInit => [],
    :TTF_GetFontKerningSize => [:pointer, :int, :int],
    :TTF_GetFontKerningSizeGlyphs => [:pointer, :ushort, :ushort],
    :TTF_GetFontKerningSizeGlyphs32 => [:pointer, :uint, :uint],
    :TTF_SetFontSDF => [:pointer, :int],
    :TTF_GetFontSDF => [:pointer],
    :TTF_SetDirection => [:int],
    :TTF_SetScript => [:int],
    :TTF_SetFontDirection => [:pointer, :int],
    :TTF_SetFontScriptName => [:pointer, :pointer],
  }
  retvals = {
    :TTF_Linked_Version => :pointer,
    :TTF_GetFreeTypeVersion => :void,
    :TTF_GetHarfBuzzVersion => :void,
    :TTF_ByteSwappedUNICODE => :void,
    :TTF_Init => :int,
    :TTF_OpenFont => :pointer,
    :TTF_OpenFontIndex => :pointer,
    :TTF_OpenFontRW => :pointer,
    :TTF_OpenFontIndexRW => :pointer,
    :TTF_OpenFontDPI => :pointer,
    :TTF_OpenFontIndexDPI => :pointer,
    :TTF_OpenFontDPIRW => :pointer,
    :TTF_OpenFontIndexDPIRW => :pointer,
    :TTF_SetFontSize => :int,
    :TTF_SetFontSizeDPI => :int,
    :TTF_GetFontStyle => :int,
    :TTF_SetFontStyle => :void,
    :TTF_GetFontOutline => :int,
    :TTF_SetFontOutline => :void,
    :TTF_GetFontHinting => :int,
    :TTF_SetFontHinting => :void,
    :TTF_GetFontWrappedAlign => :int,
    :TTF_SetFontWrappedAlign => :void,
    :TTF_FontHeight => :int,
    :TTF_FontAscent => :int,
    :TTF_FontDescent => :int,
    :TTF_FontLineSkip => :int,
    :TTF_GetFontKerning => :int,
    :TTF_SetFontKerning => :void,
    :TTF_FontFaces => :long,
    :TTF_FontFaceIsFixedWidth => :int,
    :TTF_FontFaceFamilyName => :pointer,
    :TTF_FontFaceStyleName => :pointer,
    :TTF_GlyphIsProvided => :int,
    :TTF_GlyphIsProvided32 => :int,
    :TTF_GlyphMetrics => :int,
    :TTF_GlyphMetrics32 => :int,
    :TTF_SizeText => :int,
    :TTF_SizeUTF8 => :int,
    :TTF_SizeUNICODE => :int,
    :TTF_MeasureText => :int,
    :TTF_MeasureUTF8 => :int,
    :TTF_MeasureUNICODE => :int,
    :TTF_RenderText_Solid => :pointer,
    :TTF_RenderUTF8_Solid => :pointer,
    :TTF_RenderUNICODE_Solid => :pointer,
    :TTF_RenderText_Solid_Wrapped => :pointer,
    :TTF_RenderUTF8_Solid_Wrapped => :pointer,
    :TTF_RenderUNICODE_Solid_Wrapped => :pointer,
    :TTF_RenderGlyph_Solid => :pointer,
    :TTF_RenderGlyph32_Solid => :pointer,
    :TTF_RenderText_Shaded => :pointer,
    :TTF_RenderUTF8_Shaded => :pointer,
    :TTF_RenderUNICODE_Shaded => :pointer,
    :TTF_RenderText_Shaded_Wrapped => :pointer,
    :TTF_RenderUTF8_Shaded_Wrapped => :pointer,
    :TTF_RenderUNICODE_Shaded_Wrapped => :pointer,
    :TTF_RenderGlyph_Shaded => :pointer,
    :TTF_RenderGlyph32_Shaded => :pointer,
    :TTF_RenderText_Blended => :pointer,
    :TTF_RenderUTF8_Blended => :pointer,
    :TTF_RenderUNICODE_Blended => :pointer,
    :TTF_RenderText_Blended_Wrapped => :pointer,
    :TTF_RenderUTF8_Blended_Wrapped => :pointer,
    :TTF_RenderUNICODE_Blended_Wrapped => :pointer,
    :TTF_RenderGlyph_Blended => :pointer,
    :TTF_RenderGlyph32_Blended => :pointer,
    :TTF_RenderText_LCD => :pointer,
    :TTF_RenderUTF8_LCD => :pointer,
    :TTF_RenderUNICODE_LCD => :pointer,
    :TTF_RenderText_LCD_Wrapped => :pointer,
    :TTF_RenderUTF8_LCD_Wrapped => :pointer,
    :TTF_RenderUNICODE_LCD_Wrapped => :pointer,
    :TTF_RenderGlyph_LCD => :pointer,
    :TTF_RenderGlyph32_LCD => :pointer,
    :TTF_CloseFont => :void,
    :TTF_Quit => :void,
    :TTF_WasInit => :int,
    :TTF_GetFontKerningSize => :int,
    :TTF_GetFontKerningSizeGlyphs => :int,
    :TTF_GetFontKerningSizeGlyphs32 => :int,
    :TTF_SetFontSDF => :int,
    :TTF_GetFontSDF => :int,
    :TTF_SetDirection => :int,
    :TTF_SetScript => :int,
    :TTF_SetFontDirection => :int,
    :TTF_SetFontScriptName => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_version_symbols(output_error = false) ⇒ Object

Function



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/sdl2_version.rb', line 36

def self.setup_version_symbols(output_error = false)
  symbols = [
    :SDL_GetVersion,
    :SDL_GetRevision,
    :SDL_GetRevisionNumber,
  ]
  apis = {
    :SDL_GetVersion => :GetVersion,
    :SDL_GetRevision => :GetRevision,
    :SDL_GetRevisionNumber => :GetRevisionNumber,
  }
  args = {
    :SDL_GetVersion => [:pointer],
    :SDL_GetRevision => [],
    :SDL_GetRevisionNumber => [],
  }
  retvals = {
    :SDL_GetVersion => :void,
    :SDL_GetRevision => :pointer,
    :SDL_GetRevisionNumber => :int,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_video_symbols(output_error = false) ⇒ Object

Function



155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
# File 'lib/sdl2_video.rb', line 155

def self.setup_video_symbols(output_error = false)
  symbols = [
    :SDL_GetNumVideoDrivers,
    :SDL_GetVideoDriver,
    :SDL_VideoInit,
    :SDL_VideoQuit,
    :SDL_GetCurrentVideoDriver,
    :SDL_GetNumVideoDisplays,
    :SDL_GetDisplayName,
    :SDL_GetDisplayBounds,
    :SDL_GetDisplayUsableBounds,
    :SDL_GetDisplayDPI,
    :SDL_GetDisplayOrientation,
    :SDL_GetNumDisplayModes,
    :SDL_GetDisplayMode,
    :SDL_GetDesktopDisplayMode,
    :SDL_GetCurrentDisplayMode,
    :SDL_GetClosestDisplayMode,
    :SDL_GetPointDisplayIndex,
    :SDL_GetRectDisplayIndex,
    :SDL_GetWindowDisplayIndex,
    :SDL_SetWindowDisplayMode,
    :SDL_GetWindowDisplayMode,
    :SDL_GetWindowICCProfile,
    :SDL_GetWindowPixelFormat,
    :SDL_CreateWindow,
    :SDL_CreateWindowFrom,
    :SDL_GetWindowID,
    :SDL_GetWindowFromID,
    :SDL_GetWindowFlags,
    :SDL_SetWindowTitle,
    :SDL_GetWindowTitle,
    :SDL_SetWindowIcon,
    :SDL_SetWindowData,
    :SDL_GetWindowData,
    :SDL_SetWindowPosition,
    :SDL_GetWindowPosition,
    :SDL_SetWindowSize,
    :SDL_GetWindowSize,
    :SDL_GetWindowBordersSize,
    :SDL_GetWindowSizeInPixels,
    :SDL_SetWindowMinimumSize,
    :SDL_GetWindowMinimumSize,
    :SDL_SetWindowMaximumSize,
    :SDL_GetWindowMaximumSize,
    :SDL_SetWindowBordered,
    :SDL_SetWindowResizable,
    :SDL_SetWindowAlwaysOnTop,
    :SDL_ShowWindow,
    :SDL_HideWindow,
    :SDL_RaiseWindow,
    :SDL_MaximizeWindow,
    :SDL_MinimizeWindow,
    :SDL_RestoreWindow,
    :SDL_SetWindowFullscreen,
    :SDL_HasWindowSurface,
    :SDL_GetWindowSurface,
    :SDL_UpdateWindowSurface,
    :SDL_UpdateWindowSurfaceRects,
    :SDL_DestroyWindowSurface,
    :SDL_SetWindowGrab,
    :SDL_SetWindowKeyboardGrab,
    :SDL_SetWindowMouseGrab,
    :SDL_GetWindowGrab,
    :SDL_GetWindowKeyboardGrab,
    :SDL_GetWindowMouseGrab,
    :SDL_GetGrabbedWindow,
    :SDL_SetWindowMouseRect,
    :SDL_GetWindowMouseRect,
    :SDL_SetWindowBrightness,
    :SDL_GetWindowBrightness,
    :SDL_SetWindowOpacity,
    :SDL_GetWindowOpacity,
    :SDL_SetWindowModalFor,
    :SDL_SetWindowInputFocus,
    :SDL_SetWindowGammaRamp,
    :SDL_GetWindowGammaRamp,
    :SDL_SetWindowHitTest,
    :SDL_FlashWindow,
    :SDL_DestroyWindow,
    :SDL_IsScreenSaverEnabled,
    :SDL_EnableScreenSaver,
    :SDL_DisableScreenSaver,
    :SDL_GL_LoadLibrary,
    :SDL_GL_GetProcAddress,
    :SDL_GL_UnloadLibrary,
    :SDL_GL_ExtensionSupported,
    :SDL_GL_ResetAttributes,
    :SDL_GL_SetAttribute,
    :SDL_GL_GetAttribute,
    :SDL_GL_CreateContext,
    :SDL_GL_MakeCurrent,
    :SDL_GL_GetCurrentWindow,
    :SDL_GL_GetCurrentContext,
    :SDL_GL_GetDrawableSize,
    :SDL_GL_SetSwapInterval,
    :SDL_GL_GetSwapInterval,
    :SDL_GL_SwapWindow,
    :SDL_GL_DeleteContext,
  ]
  apis = {
    :SDL_GetNumVideoDrivers => :GetNumVideoDrivers,
    :SDL_GetVideoDriver => :GetVideoDriver,
    :SDL_VideoInit => :VideoInit,
    :SDL_VideoQuit => :VideoQuit,
    :SDL_GetCurrentVideoDriver => :GetCurrentVideoDriver,
    :SDL_GetNumVideoDisplays => :GetNumVideoDisplays,
    :SDL_GetDisplayName => :GetDisplayName,
    :SDL_GetDisplayBounds => :GetDisplayBounds,
    :SDL_GetDisplayUsableBounds => :GetDisplayUsableBounds,
    :SDL_GetDisplayDPI => :GetDisplayDPI,
    :SDL_GetDisplayOrientation => :GetDisplayOrientation,
    :SDL_GetNumDisplayModes => :GetNumDisplayModes,
    :SDL_GetDisplayMode => :GetDisplayMode,
    :SDL_GetDesktopDisplayMode => :GetDesktopDisplayMode,
    :SDL_GetCurrentDisplayMode => :GetCurrentDisplayMode,
    :SDL_GetClosestDisplayMode => :GetClosestDisplayMode,
    :SDL_GetPointDisplayIndex => :GetPointDisplayIndex,
    :SDL_GetRectDisplayIndex => :GetRectDisplayIndex,
    :SDL_GetWindowDisplayIndex => :GetWindowDisplayIndex,
    :SDL_SetWindowDisplayMode => :SetWindowDisplayMode,
    :SDL_GetWindowDisplayMode => :GetWindowDisplayMode,
    :SDL_GetWindowICCProfile => :GetWindowICCProfile,
    :SDL_GetWindowPixelFormat => :GetWindowPixelFormat,
    :SDL_CreateWindow => :CreateWindow,
    :SDL_CreateWindowFrom => :CreateWindowFrom,
    :SDL_GetWindowID => :GetWindowID,
    :SDL_GetWindowFromID => :GetWindowFromID,
    :SDL_GetWindowFlags => :GetWindowFlags,
    :SDL_SetWindowTitle => :SetWindowTitle,
    :SDL_GetWindowTitle => :GetWindowTitle,
    :SDL_SetWindowIcon => :SetWindowIcon,
    :SDL_SetWindowData => :SetWindowData,
    :SDL_GetWindowData => :GetWindowData,
    :SDL_SetWindowPosition => :SetWindowPosition,
    :SDL_GetWindowPosition => :GetWindowPosition,
    :SDL_SetWindowSize => :SetWindowSize,
    :SDL_GetWindowSize => :GetWindowSize,
    :SDL_GetWindowBordersSize => :GetWindowBordersSize,
    :SDL_GetWindowSizeInPixels => :GetWindowSizeInPixels,
    :SDL_SetWindowMinimumSize => :SetWindowMinimumSize,
    :SDL_GetWindowMinimumSize => :GetWindowMinimumSize,
    :SDL_SetWindowMaximumSize => :SetWindowMaximumSize,
    :SDL_GetWindowMaximumSize => :GetWindowMaximumSize,
    :SDL_SetWindowBordered => :SetWindowBordered,
    :SDL_SetWindowResizable => :SetWindowResizable,
    :SDL_SetWindowAlwaysOnTop => :SetWindowAlwaysOnTop,
    :SDL_ShowWindow => :ShowWindow,
    :SDL_HideWindow => :HideWindow,
    :SDL_RaiseWindow => :RaiseWindow,
    :SDL_MaximizeWindow => :MaximizeWindow,
    :SDL_MinimizeWindow => :MinimizeWindow,
    :SDL_RestoreWindow => :RestoreWindow,
    :SDL_SetWindowFullscreen => :SetWindowFullscreen,
    :SDL_HasWindowSurface => :HasWindowSurface,
    :SDL_GetWindowSurface => :GetWindowSurface,
    :SDL_UpdateWindowSurface => :UpdateWindowSurface,
    :SDL_UpdateWindowSurfaceRects => :UpdateWindowSurfaceRects,
    :SDL_DestroyWindowSurface => :DestroyWindowSurface,
    :SDL_SetWindowGrab => :SetWindowGrab,
    :SDL_SetWindowKeyboardGrab => :SetWindowKeyboardGrab,
    :SDL_SetWindowMouseGrab => :SetWindowMouseGrab,
    :SDL_GetWindowGrab => :GetWindowGrab,
    :SDL_GetWindowKeyboardGrab => :GetWindowKeyboardGrab,
    :SDL_GetWindowMouseGrab => :GetWindowMouseGrab,
    :SDL_GetGrabbedWindow => :GetGrabbedWindow,
    :SDL_SetWindowMouseRect => :SetWindowMouseRect,
    :SDL_GetWindowMouseRect => :GetWindowMouseRect,
    :SDL_SetWindowBrightness => :SetWindowBrightness,
    :SDL_GetWindowBrightness => :GetWindowBrightness,
    :SDL_SetWindowOpacity => :SetWindowOpacity,
    :SDL_GetWindowOpacity => :GetWindowOpacity,
    :SDL_SetWindowModalFor => :SetWindowModalFor,
    :SDL_SetWindowInputFocus => :SetWindowInputFocus,
    :SDL_SetWindowGammaRamp => :SetWindowGammaRamp,
    :SDL_GetWindowGammaRamp => :GetWindowGammaRamp,
    :SDL_SetWindowHitTest => :SetWindowHitTest,
    :SDL_FlashWindow => :FlashWindow,
    :SDL_DestroyWindow => :DestroyWindow,
    :SDL_IsScreenSaverEnabled => :IsScreenSaverEnabled,
    :SDL_EnableScreenSaver => :EnableScreenSaver,
    :SDL_DisableScreenSaver => :DisableScreenSaver,
    :SDL_GL_LoadLibrary => :GL_LoadLibrary,
    :SDL_GL_GetProcAddress => :GL_GetProcAddress,
    :SDL_GL_UnloadLibrary => :GL_UnloadLibrary,
    :SDL_GL_ExtensionSupported => :GL_ExtensionSupported,
    :SDL_GL_ResetAttributes => :GL_ResetAttributes,
    :SDL_GL_SetAttribute => :GL_SetAttribute,
    :SDL_GL_GetAttribute => :GL_GetAttribute,
    :SDL_GL_CreateContext => :GL_CreateContext,
    :SDL_GL_MakeCurrent => :GL_MakeCurrent,
    :SDL_GL_GetCurrentWindow => :GL_GetCurrentWindow,
    :SDL_GL_GetCurrentContext => :GL_GetCurrentContext,
    :SDL_GL_GetDrawableSize => :GL_GetDrawableSize,
    :SDL_GL_SetSwapInterval => :GL_SetSwapInterval,
    :SDL_GL_GetSwapInterval => :GL_GetSwapInterval,
    :SDL_GL_SwapWindow => :GL_SwapWindow,
    :SDL_GL_DeleteContext => :GL_DeleteContext,
  }
  args = {
    :SDL_GetNumVideoDrivers => [],
    :SDL_GetVideoDriver => [:int],
    :SDL_VideoInit => [:pointer],
    :SDL_VideoQuit => [],
    :SDL_GetCurrentVideoDriver => [],
    :SDL_GetNumVideoDisplays => [],
    :SDL_GetDisplayName => [:int],
    :SDL_GetDisplayBounds => [:int, :pointer],
    :SDL_GetDisplayUsableBounds => [:int, :pointer],
    :SDL_GetDisplayDPI => [:int, :pointer, :pointer, :pointer],
    :SDL_GetDisplayOrientation => [:int],
    :SDL_GetNumDisplayModes => [:int],
    :SDL_GetDisplayMode => [:int, :int, :pointer],
    :SDL_GetDesktopDisplayMode => [:int, :pointer],
    :SDL_GetCurrentDisplayMode => [:int, :pointer],
    :SDL_GetClosestDisplayMode => [:int, :pointer, :pointer],
    :SDL_GetPointDisplayIndex => [:pointer],
    :SDL_GetRectDisplayIndex => [:pointer],
    :SDL_GetWindowDisplayIndex => [:pointer],
    :SDL_SetWindowDisplayMode => [:pointer, :pointer],
    :SDL_GetWindowDisplayMode => [:pointer, :pointer],
    :SDL_GetWindowICCProfile => [:pointer, :pointer],
    :SDL_GetWindowPixelFormat => [:pointer],
    :SDL_CreateWindow => [:pointer, :int, :int, :int, :int, :uint],
    :SDL_CreateWindowFrom => [:pointer],
    :SDL_GetWindowID => [:pointer],
    :SDL_GetWindowFromID => [:uint],
    :SDL_GetWindowFlags => [:pointer],
    :SDL_SetWindowTitle => [:pointer, :pointer],
    :SDL_GetWindowTitle => [:pointer],
    :SDL_SetWindowIcon => [:pointer, :pointer],
    :SDL_SetWindowData => [:pointer, :pointer, :pointer],
    :SDL_GetWindowData => [:pointer, :pointer],
    :SDL_SetWindowPosition => [:pointer, :int, :int],
    :SDL_GetWindowPosition => [:pointer, :pointer, :pointer],
    :SDL_SetWindowSize => [:pointer, :int, :int],
    :SDL_GetWindowSize => [:pointer, :pointer, :pointer],
    :SDL_GetWindowBordersSize => [:pointer, :pointer, :pointer, :pointer, :pointer],
    :SDL_GetWindowSizeInPixels => [:pointer, :pointer, :pointer],
    :SDL_SetWindowMinimumSize => [:pointer, :int, :int],
    :SDL_GetWindowMinimumSize => [:pointer, :pointer, :pointer],
    :SDL_SetWindowMaximumSize => [:pointer, :int, :int],
    :SDL_GetWindowMaximumSize => [:pointer, :pointer, :pointer],
    :SDL_SetWindowBordered => [:pointer, :int],
    :SDL_SetWindowResizable => [:pointer, :int],
    :SDL_SetWindowAlwaysOnTop => [:pointer, :int],
    :SDL_ShowWindow => [:pointer],
    :SDL_HideWindow => [:pointer],
    :SDL_RaiseWindow => [:pointer],
    :SDL_MaximizeWindow => [:pointer],
    :SDL_MinimizeWindow => [:pointer],
    :SDL_RestoreWindow => [:pointer],
    :SDL_SetWindowFullscreen => [:pointer, :uint],
    :SDL_HasWindowSurface => [:pointer],
    :SDL_GetWindowSurface => [:pointer],
    :SDL_UpdateWindowSurface => [:pointer],
    :SDL_UpdateWindowSurfaceRects => [:pointer, :pointer, :int],
    :SDL_DestroyWindowSurface => [:pointer],
    :SDL_SetWindowGrab => [:pointer, :int],
    :SDL_SetWindowKeyboardGrab => [:pointer, :int],
    :SDL_SetWindowMouseGrab => [:pointer, :int],
    :SDL_GetWindowGrab => [:pointer],
    :SDL_GetWindowKeyboardGrab => [:pointer],
    :SDL_GetWindowMouseGrab => [:pointer],
    :SDL_GetGrabbedWindow => [],
    :SDL_SetWindowMouseRect => [:pointer, :pointer],
    :SDL_GetWindowMouseRect => [:pointer],
    :SDL_SetWindowBrightness => [:pointer, :float],
    :SDL_GetWindowBrightness => [:pointer],
    :SDL_SetWindowOpacity => [:pointer, :float],
    :SDL_GetWindowOpacity => [:pointer, :pointer],
    :SDL_SetWindowModalFor => [:pointer, :pointer],
    :SDL_SetWindowInputFocus => [:pointer],
    :SDL_SetWindowGammaRamp => [:pointer, :pointer, :pointer, :pointer],
    :SDL_GetWindowGammaRamp => [:pointer, :pointer, :pointer, :pointer],
    :SDL_SetWindowHitTest => [:pointer, :SDL_HitTest, :pointer],
    :SDL_FlashWindow => [:pointer, :int],
    :SDL_DestroyWindow => [:pointer],
    :SDL_IsScreenSaverEnabled => [],
    :SDL_EnableScreenSaver => [],
    :SDL_DisableScreenSaver => [],
    :SDL_GL_LoadLibrary => [:pointer],
    :SDL_GL_GetProcAddress => [:pointer],
    :SDL_GL_UnloadLibrary => [],
    :SDL_GL_ExtensionSupported => [:pointer],
    :SDL_GL_ResetAttributes => [],
    :SDL_GL_SetAttribute => [:int, :int],
    :SDL_GL_GetAttribute => [:int, :pointer],
    :SDL_GL_CreateContext => [:pointer],
    :SDL_GL_MakeCurrent => [:pointer, :pointer],
    :SDL_GL_GetCurrentWindow => [],
    :SDL_GL_GetCurrentContext => [],
    :SDL_GL_GetDrawableSize => [:pointer, :pointer, :pointer],
    :SDL_GL_SetSwapInterval => [:int],
    :SDL_GL_GetSwapInterval => [],
    :SDL_GL_SwapWindow => [:pointer],
    :SDL_GL_DeleteContext => [:pointer],
  }
  retvals = {
    :SDL_GetNumVideoDrivers => :int,
    :SDL_GetVideoDriver => :pointer,
    :SDL_VideoInit => :int,
    :SDL_VideoQuit => :void,
    :SDL_GetCurrentVideoDriver => :pointer,
    :SDL_GetNumVideoDisplays => :int,
    :SDL_GetDisplayName => :pointer,
    :SDL_GetDisplayBounds => :int,
    :SDL_GetDisplayUsableBounds => :int,
    :SDL_GetDisplayDPI => :int,
    :SDL_GetDisplayOrientation => :int,
    :SDL_GetNumDisplayModes => :int,
    :SDL_GetDisplayMode => :int,
    :SDL_GetDesktopDisplayMode => :int,
    :SDL_GetCurrentDisplayMode => :int,
    :SDL_GetClosestDisplayMode => :pointer,
    :SDL_GetPointDisplayIndex => :int,
    :SDL_GetRectDisplayIndex => :int,
    :SDL_GetWindowDisplayIndex => :int,
    :SDL_SetWindowDisplayMode => :int,
    :SDL_GetWindowDisplayMode => :int,
    :SDL_GetWindowICCProfile => :pointer,
    :SDL_GetWindowPixelFormat => :uint,
    :SDL_CreateWindow => :pointer,
    :SDL_CreateWindowFrom => :pointer,
    :SDL_GetWindowID => :uint,
    :SDL_GetWindowFromID => :pointer,
    :SDL_GetWindowFlags => :uint,
    :SDL_SetWindowTitle => :void,
    :SDL_GetWindowTitle => :pointer,
    :SDL_SetWindowIcon => :void,
    :SDL_SetWindowData => :pointer,
    :SDL_GetWindowData => :pointer,
    :SDL_SetWindowPosition => :void,
    :SDL_GetWindowPosition => :void,
    :SDL_SetWindowSize => :void,
    :SDL_GetWindowSize => :void,
    :SDL_GetWindowBordersSize => :int,
    :SDL_GetWindowSizeInPixels => :void,
    :SDL_SetWindowMinimumSize => :void,
    :SDL_GetWindowMinimumSize => :void,
    :SDL_SetWindowMaximumSize => :void,
    :SDL_GetWindowMaximumSize => :void,
    :SDL_SetWindowBordered => :void,
    :SDL_SetWindowResizable => :void,
    :SDL_SetWindowAlwaysOnTop => :void,
    :SDL_ShowWindow => :void,
    :SDL_HideWindow => :void,
    :SDL_RaiseWindow => :void,
    :SDL_MaximizeWindow => :void,
    :SDL_MinimizeWindow => :void,
    :SDL_RestoreWindow => :void,
    :SDL_SetWindowFullscreen => :int,
    :SDL_HasWindowSurface => :int,
    :SDL_GetWindowSurface => :pointer,
    :SDL_UpdateWindowSurface => :int,
    :SDL_UpdateWindowSurfaceRects => :int,
    :SDL_DestroyWindowSurface => :int,
    :SDL_SetWindowGrab => :void,
    :SDL_SetWindowKeyboardGrab => :void,
    :SDL_SetWindowMouseGrab => :void,
    :SDL_GetWindowGrab => :int,
    :SDL_GetWindowKeyboardGrab => :int,
    :SDL_GetWindowMouseGrab => :int,
    :SDL_GetGrabbedWindow => :pointer,
    :SDL_SetWindowMouseRect => :int,
    :SDL_GetWindowMouseRect => :pointer,
    :SDL_SetWindowBrightness => :int,
    :SDL_GetWindowBrightness => :float,
    :SDL_SetWindowOpacity => :int,
    :SDL_GetWindowOpacity => :int,
    :SDL_SetWindowModalFor => :int,
    :SDL_SetWindowInputFocus => :int,
    :SDL_SetWindowGammaRamp => :int,
    :SDL_GetWindowGammaRamp => :int,
    :SDL_SetWindowHitTest => :int,
    :SDL_FlashWindow => :int,
    :SDL_DestroyWindow => :void,
    :SDL_IsScreenSaverEnabled => :int,
    :SDL_EnableScreenSaver => :void,
    :SDL_DisableScreenSaver => :void,
    :SDL_GL_LoadLibrary => :int,
    :SDL_GL_GetProcAddress => :pointer,
    :SDL_GL_UnloadLibrary => :void,
    :SDL_GL_ExtensionSupported => :int,
    :SDL_GL_ResetAttributes => :void,
    :SDL_GL_SetAttribute => :int,
    :SDL_GL_GetAttribute => :int,
    :SDL_GL_CreateContext => :pointer,
    :SDL_GL_MakeCurrent => :int,
    :SDL_GL_GetCurrentWindow => :pointer,
    :SDL_GL_GetCurrentContext => :pointer,
    :SDL_GL_GetDrawableSize => :void,
    :SDL_GL_SetSwapInterval => :int,
    :SDL_GL_GetSwapInterval => :int,
    :SDL_GL_SwapWindow => :void,
    :SDL_GL_DeleteContext => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end

.setup_vulkan_symbols(output_error = false) ⇒ Object

Function



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# File 'lib/sdl2_vulkan.rb', line 29

def self.setup_vulkan_symbols(output_error = false)
  symbols = [
    :SDL_Vulkan_LoadLibrary,
    :SDL_Vulkan_GetVkGetInstanceProcAddr,
    :SDL_Vulkan_UnloadLibrary,
    :SDL_Vulkan_GetInstanceExtensions,
    :SDL_Vulkan_CreateSurface,
    :SDL_Vulkan_GetDrawableSize,
  ]
  apis = {
    :SDL_Vulkan_LoadLibrary => :Vulkan_LoadLibrary,
    :SDL_Vulkan_GetVkGetInstanceProcAddr => :Vulkan_GetVkGetInstanceProcAddr,
    :SDL_Vulkan_UnloadLibrary => :Vulkan_UnloadLibrary,
    :SDL_Vulkan_GetInstanceExtensions => :Vulkan_GetInstanceExtensions,
    :SDL_Vulkan_CreateSurface => :Vulkan_CreateSurface,
    :SDL_Vulkan_GetDrawableSize => :Vulkan_GetDrawableSize,
  }
  args = {
    :SDL_Vulkan_LoadLibrary => [:pointer],
    :SDL_Vulkan_GetVkGetInstanceProcAddr => [],
    :SDL_Vulkan_UnloadLibrary => [],
    :SDL_Vulkan_GetInstanceExtensions => [:pointer, :pointer, :pointer],
    :SDL_Vulkan_CreateSurface => [:pointer, :pointer, :pointer],
    :SDL_Vulkan_GetDrawableSize => [:pointer, :pointer, :pointer],
  }
  retvals = {
    :SDL_Vulkan_LoadLibrary => :int,
    :SDL_Vulkan_GetVkGetInstanceProcAddr => :pointer,
    :SDL_Vulkan_UnloadLibrary => :void,
    :SDL_Vulkan_GetInstanceExtensions => :int,
    :SDL_Vulkan_CreateSurface => :int,
    :SDL_Vulkan_GetDrawableSize => :void,
  }
  symbols.each do |sym|
    begin
      attach_function apis[sym], sym, args[sym], retvals[sym]
    rescue FFI::NotFoundError => error
      $stderr.puts("[Warning] Failed to import #{sym} (#{error}).") if output_error
    end
  end
end