Skip to content

jbreeden/mruby-sdl2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mruby-sdl2

MRuby bindings to the SDL2 library. Generated by mruby-bindings.

Building

  1. Download SDL & SDL_image & ./configure && make && sudo make install

  2. Download this repo, then update your mruby build_config.rb file:

# This gem requires a 64 bit build of MRuby
[conf.cc.flags, conf.cxx.flags].each do |flags|
  flags << '-DMRB_INT64'
end
conf.gem 'PATH/TO/mruby-sdl'
  1. Finally, build MRuby with rake

What's in the box?

This project is brand new. Low level bindings to many of the SDL functions are already working, but the goal is to create an object oriented layer above these functions that provides a more idiomatic Ruby API. This API would allow MRuby to be embedded in SDL applications as a quick scripting solution, or the creation of simple SDL applications purely in MRuby.

Functions bound so far are listed below. They are all provided under the SDL module. There may be some bugs present in the bindings as no unit tests have been written yet.

IMG_Init
IMG_Load
IMG_LoadBMP_RW
IMG_LoadCUR_RW
IMG_LoadGIF_RW
IMG_LoadICO_RW
IMG_LoadJPG_RW
IMG_LoadLBM_RW
IMG_LoadPCX_RW
IMG_LoadPNG_RW
IMG_LoadPNM_RW
IMG_LoadTGA_RW
IMG_LoadTIF_RW
IMG_LoadTexture
IMG_LoadTextureTyped_RW
IMG_LoadTexture_RW
IMG_LoadTyped_RW
IMG_LoadWEBP_RW
IMG_LoadXCF_RW
IMG_LoadXPM_RW
IMG_LoadXV_RW
IMG_Load_RW
IMG_Quit
IMG_SavePNG
IMG_SavePNG_RW
IMG_isBMP
IMG_isCUR
IMG_isGIF
IMG_isICO
IMG_isJPG
IMG_isLBM
IMG_isPCX
IMG_isPNG
IMG_isPNM
IMG_isTIF
IMG_isWEBP
IMG_isXCF
IMG_isXPM
IMG_isXV
SDL_AllocFormat
SDL_AllocPalette
SDL_AllocRW
SDL_AtomicAdd
SDL_AtomicCAS
SDL_AtomicGet
SDL_AtomicSet
SDL_AudioInit
SDL_AudioQuit
SDL_BlitSurface
SDL_BuildAudioCVT
SDL_ClearError
SDL_ClearHints
SDL_CloseAudio
SDL_CloseAudioDevice
SDL_CondBroadcast
SDL_CondSignal
SDL_CondWait
SDL_CondWaitTimeout
SDL_ConvertAudio
SDL_ConvertSurface
SDL_ConvertSurfaceFormat
SDL_CreateColorCursor
SDL_CreateCond
SDL_CreateMutex
SDL_CreateRGBSurface
SDL_CreateRenderer
SDL_CreateSemaphore
SDL_CreateShapedWindow
SDL_CreateSoftwareRenderer
SDL_CreateTexture
SDL_CreateTextureFromSurface
SDL_CreateWindow
SDL_Delay
SDL_DestroyCond
SDL_DestroyMutex
SDL_DestroyRenderer
SDL_DestroySemaphore
SDL_DestroyTexture
SDL_DestroyWindow
SDL_DetachThread
SDL_DisableScreenSaver
SDL_EnableScreenSaver
SDL_EnclosePoints
SDL_EventState
SDL_FillRect
SDL_FillRects
SDL_FlushEvent
SDL_FlushEvents
SDL_FreeCursor
SDL_FreeFormat
SDL_FreePalette
SDL_FreeRW
SDL_FreeSurface
SDL_GL_ExtensionSupported
SDL_GL_GetCurrentWindow
SDL_GL_GetSwapInterval
SDL_GL_LoadLibrary
SDL_GL_ResetAttributes
SDL_GL_SetSwapInterval
SDL_GL_SwapWindow
SDL_GL_UnbindTexture
SDL_GL_UnloadLibrary
SDL_GameControllerAddMapping
SDL_GameControllerAddMappingsFromRW
SDL_GameControllerClose
SDL_GameControllerEventState
SDL_GameControllerGetAttached
SDL_GameControllerGetJoystick
SDL_GameControllerMapping
SDL_GameControllerMappingForGUID
SDL_GameControllerName
SDL_GameControllerNameForIndex
SDL_GameControllerOpen
SDL_GameControllerUpdate
SDL_GetAudioDeviceName
SDL_GetAudioDriver
SDL_GetBasePath
SDL_GetCPUCacheLineSize
SDL_GetCPUCount
SDL_GetClipRect
SDL_GetClipboardText
SDL_GetClosestDisplayMode
SDL_GetColorKey
SDL_GetCurrentAudioDriver
SDL_GetCurrentDisplayMode
SDL_GetCurrentVideoDriver
SDL_GetCursor
SDL_GetDefaultCursor
SDL_GetDesktopDisplayMode
SDL_GetDisplayBounds
SDL_GetDisplayMode
SDL_GetDisplayName
SDL_GetError
SDL_GetHint
SDL_GetKeyName
SDL_GetKeyboardFocus
SDL_GetMouseFocus
SDL_GetNumAudioDevices
SDL_GetNumAudioDrivers
SDL_GetNumDisplayModes
SDL_GetNumRenderDrivers
SDL_GetNumTouchDevices
SDL_GetNumTouchFingers
SDL_GetNumVideoDisplays
SDL_GetNumVideoDrivers
SDL_GetPixelFormatName
SDL_GetPlatform
SDL_GetPrefPath
SDL_GetRelativeMouseMode
SDL_GetRenderDriverInfo
SDL_GetRenderTarget
SDL_GetRenderer
SDL_GetRendererInfo
SDL_GetRevision
SDL_GetRevisionNumber
SDL_GetShapedWindowMode
SDL_GetSystemRAM
SDL_GetThreadID
SDL_GetThreadName
SDL_GetTicks
SDL_GetTouchFinger
SDL_GetVersion
SDL_GetVideoDriver
SDL_GetWindowBrightness
SDL_GetWindowDisplayIndex
SDL_GetWindowDisplayMode
SDL_GetWindowFromID
SDL_GetWindowGrab
SDL_GetWindowSurface
SDL_GetWindowTitle
SDL_GetWindowWMInfo
SDL_HapticClose
SDL_HapticDestroyEffect
SDL_HapticGetEffectStatus
SDL_HapticIndex
SDL_HapticName
SDL_HapticNumAxes
SDL_HapticNumEffects
SDL_HapticNumEffectsPlaying
SDL_HapticOpen
SDL_HapticOpenFromJoystick
SDL_HapticOpenFromMouse
SDL_HapticOpened
SDL_HapticPause
SDL_HapticQuery
SDL_HapticRumbleInit
SDL_HapticRumblePlay
SDL_HapticRumbleStop
SDL_HapticRumbleSupported
SDL_HapticRunEffect
SDL_HapticSetAutocenter
SDL_HapticSetGain
SDL_HapticStopAll
SDL_HapticStopEffect
SDL_HapticUnpause
SDL_Has3DNow
SDL_HasAVX
SDL_HasAltiVec
SDL_HasClipboardText
SDL_HasEvent
SDL_HasEvents
SDL_HasIntersection
SDL_HasMMX
SDL_HasRDTSC
SDL_HasSSE
SDL_HasSSE2
SDL_HasSSE3
SDL_HasSSE41
SDL_HasSSE42
SDL_HasScreenKeyboardSupport
SDL_HideWindow
SDL_Init
SDL_InitSubSystem
SDL_IntersectRect
SDL_IsGameController
SDL_IsScreenKeyboardShown
SDL_IsScreenSaverEnabled
SDL_IsShapedWindow
SDL_IsTextInputActive
SDL_JoystickClose
SDL_JoystickEventState
SDL_JoystickGetAttached
SDL_JoystickGetDeviceGUID
SDL_JoystickGetGUID
SDL_JoystickGetGUIDFromString
SDL_JoystickGetGUIDString
SDL_JoystickIsHaptic
SDL_JoystickName
SDL_JoystickNameForIndex
SDL_JoystickNumAxes
SDL_JoystickNumBalls
SDL_JoystickNumButtons
SDL_JoystickNumHats
SDL_JoystickOpen
SDL_JoystickUpdate
SDL_LoadBMP_RW
SDL_LoadDollarTemplates
SDL_LockAudio
SDL_LockAudioDevice
SDL_LockMutex
SDL_LockSurface
SDL_Log
SDL_LogCritical
SDL_LogDebug
SDL_LogError
SDL_LogInfo
SDL_LogResetPriorities
SDL_LogVerbose
SDL_LogWarn
SDL_LowerBlit
SDL_LowerBlitScaled
SDL_MaximizeWindow
SDL_MinimizeWindow
SDL_MostSignificantBitIndex32
SDL_MouseIsHaptic
SDL_NumHaptics
SDL_NumJoysticks
SDL_OpenAudio
SDL_PauseAudio
SDL_PauseAudioDevice
SDL_PollEvent
SDL_PumpEvents
SDL_Quit
SDL_QuitSubSystem
SDL_RWFromFile
SDL_RaiseWindow
SDL_RecordGesture
SDL_RectEmpty
SDL_RectEquals
SDL_RemoveTimer
SDL_RenderClear
SDL_RenderCopy
SDL_RenderDrawLine
SDL_RenderDrawLines
SDL_RenderDrawPoint
SDL_RenderDrawPoints
SDL_RenderDrawRect
SDL_RenderDrawRects
SDL_RenderFillRect
SDL_RenderFillRects
SDL_RenderGetClipRect
SDL_RenderGetViewport
SDL_RenderPresent
SDL_RenderSetClipRect
SDL_RenderSetLogicalSize
SDL_RenderSetScale
SDL_RenderSetViewport
SDL_RenderTargetSupported
SDL_ResetAssertionReport
SDL_RestoreWindow
SDL_SaveAllDollarTemplates
SDL_SaveBMP_RW
SDL_SaveDollarTemplate
SDL_SemPost
SDL_SemTryWait
SDL_SemWait
SDL_SemWaitTimeout
SDL_SetClipRect
SDL_SetClipboardText
SDL_SetColorKey
SDL_SetCursor
SDL_SetError
SDL_SetHint
SDL_SetMainReady
SDL_SetPaletteColors
SDL_SetPixelFormatPalette
SDL_SetRenderDrawColor
SDL_SetRenderTarget
SDL_SetSurfaceAlphaMod
SDL_SetSurfaceColorMod
SDL_SetSurfacePalette
SDL_SetSurfaceRLE
SDL_SetTextInputRect
SDL_SetTextureAlphaMod
SDL_SetTextureColorMod
SDL_SetWindowBordered
SDL_SetWindowBrightness
SDL_SetWindowDisplayMode
SDL_SetWindowFullscreen
SDL_SetWindowIcon
SDL_SetWindowMaximumSize
SDL_SetWindowMinimumSize
SDL_SetWindowPosition
SDL_SetWindowShape
SDL_SetWindowSize
SDL_SetWindowTitle
SDL_ShowCursor
SDL_ShowSimpleMessageBox
SDL_ShowWindow
SDL_SoftStretch
SDL_StartTextInput
SDL_StopTextInput
SDL_SwapFloat
SDL_TLSCreate
SDL_ThreadID
SDL_TryLockMutex
SDL_UnionRect
SDL_UnlockAudio
SDL_UnlockAudioDevice
SDL_UnlockMutex
SDL_UnlockSurface
SDL_UnlockTexture
SDL_UpdateWindowSurface
SDL_UpdateWindowSurfaceRects
SDL_UpperBlit
SDL_UpperBlitScaled
SDL_VideoInit
SDL_VideoQuit
SDL_WarpMouseInWindow
SDL_abs
SDL_acos
SDL_asin
SDL_atan
SDL_atan2
SDL_atof
SDL_atoi
SDL_ceil
SDL_copysign
SDL_cos
SDL_cosf
SDL_fabs
SDL_floor
SDL_getenv
SDL_iconv_close
SDL_iconv_open
SDL_iconv_string
SDL_isdigit
SDL_isspace
SDL_itoa
SDL_lltoa
SDL_log
SDL_ltoa
SDL_pow
SDL_scalbn
SDL_setenv
SDL_sin
SDL_sinf
SDL_snprintf
SDL_sqrt
SDL_sscanf
SDL_strcasecmp
SDL_strchr
SDL_strcmp
SDL_strdup
SDL_strlwr
SDL_strncasecmp
SDL_strncmp
SDL_strrchr
SDL_strrev
SDL_strstr
SDL_strupr
SDL_tolower
SDL_toupper
SDL_uitoa
SDL_ulltoa
SDL_ultoa

About

MRuby bindings to the SDL2 library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published