Module Rubygame
In: ext/rubygame/rubygame_mixer.c
ext/rubygame/rubygame_joystick.c
ext/rubygame/rubygame_ttf.c
ext/rubygame/rubygame_clock.c
ext/rubygame/rubygame_main.c
ext/rubygame/rubygame_surface.c
ext/rubygame/rubygame_image.c
ext/rubygame/rubygame_shared.c
ext/rubygame/rubygame_sound.c
ext/rubygame/rubygame_event2.c
ext/rubygame/rubygame_gl.c
ext/rubygame/rubygame_music.c
ext/rubygame/rubygame_screen.c
ext/rubygame/rubygame_event.c
ext/rubygame/rubygame_gfx.c
lib/rubygame/sprite.rb
lib/rubygame/constants.rb
lib/rubygame/event_hook.rb
lib/rubygame/color.rb
lib/rubygame/events/misc_events.rb
lib/rubygame/events/joystick_events.rb
lib/rubygame/events/mouse_events.rb
lib/rubygame/events/keyboard_events.rb
lib/rubygame/events/clock_events.rb
lib/rubygame/shared.rb
lib/rubygame/sfont.rb
lib/rubygame/ftor.rb
lib/rubygame/named_resource.rb
lib/rubygame/clock.rb
lib/rubygame/color/models/hsv.rb
lib/rubygame/color/models/rgb.rb
lib/rubygame/color/models/base.rb
lib/rubygame/color/models/hsl.rb
lib/rubygame/color/palettes/css.rb
lib/rubygame/color/palettes/x11.rb
lib/rubygame/mediabag.rb
lib/rubygame/rect.rb
lib/rubygame/event.rb
lib/rubygame/events.rb
lib/rubygame/queue.rb
lib/rubygame/hotspot.rb

Hotspot, a mixin module to extend an object with custom, named, relative position offsets.

Methods

Classes and Modules

Module Rubygame::Color
Module Rubygame::EventActions
Module Rubygame::EventTriggers
Module Rubygame::Events
Module Rubygame::GL
Module Rubygame::Hotspot
Module Rubygame::Key
Module Rubygame::MailQueue
Module Rubygame::Mixer
Module Rubygame::Mouse
Module Rubygame::NamedResource
Module Rubygame::Sprites
Class Rubygame::ActiveEvent
Class Rubygame::Clock
Class Rubygame::Event
Class Rubygame::EventHandler
Class Rubygame::EventHook
Class Rubygame::EventQueue
Class Rubygame::ExposeEvent
Class Rubygame::Ftor
Class Rubygame::JoyAxisEvent
Class Rubygame::JoyBallEvent
Class Rubygame::JoyDownEvent
Class Rubygame::JoyHatEvent
Class Rubygame::JoyUpEvent
Class Rubygame::Joystick
Class Rubygame::KeyDownEvent
Class Rubygame::KeyUpEvent
Class Rubygame::MediaBag
Class Rubygame::MouseDownEvent
Class Rubygame::MouseMotionEvent
Class Rubygame::MouseUpEvent
Class Rubygame::Music
Class Rubygame::QuitEvent
Class Rubygame::Rect
Class Rubygame::ResizeEvent
Class Rubygame::SDLError
Class Rubygame::SFont
Class Rubygame::Screen
Class Rubygame::Sound
Class Rubygame::Surface
Class Rubygame::TTF

Constants

INIT_TIMER = INT2NUM(SDL_INIT_TIMER)   Flags for subsystem initialization
INIT_AUDIO = INT2NUM(SDL_INIT_AUDIO)
INIT_VIDEO = INT2NUM(SDL_INIT_VIDEO)
INIT_CDROM = INT2NUM(SDL_INIT_CDROM)
INIT_JOYSTICK = INT2NUM(SDL_INIT_JOYSTICK)
INIT_NOPARACHUTE = INT2NUM(SDL_INIT_NOPARACHUTE)
INIT_EVENTTHREAD = UINT2NUM(SDL_INIT_EVENTTHREAD)
INIT_EVERYTHING = UINT2NUM(SDL_INIT_EVERYTHING)
ALPHA_OPAQUE = UINT2NUM(SDL_ALPHA_OPAQUE)   Define fully opaque and full transparent (0 and 255)
ALPHA_TRANSPARENT = UINT2NUM(SDL_ALPHA_TRANSPARENT)
LOGPAL = UINT2NUM(SDL_LOGPAL)   Flags for palettes (?)
PHYSPAL = UINT2NUM(SDL_PHYSPAL)
SWSURFACE = UINT2NUM(SDL_SWSURFACE)   Surface initialization flags
HWSURFACE = UINT2NUM(SDL_HWSURFACE)
ASYNCBLIT = UINT2NUM(SDL_ASYNCBLIT)
ANYFORMAT = UINT2NUM(SDL_ANYFORMAT)
HWPALETTE = UINT2NUM(SDL_HWPALETTE)
HWACCEL = UINT2NUM(SDL_HWACCEL)
SRCCOLORKEY = UINT2NUM(SDL_SRCCOLORKEY)
RLEACCELOK = UINT2NUM(SDL_RLEACCELOK)
RLEACCEL = UINT2NUM(SDL_RLEACCEL)
SRCALPHA = UINT2NUM(SDL_SRCALPHA)
PREALLOC = UINT2NUM(SDL_PREALLOC)
VERSIONS = rb_hash_new()   A Hash containing the version s of rubygame and it‘s
    compile-time dependencies.
DOUBLEBUF = UINT2NUM(SDL_DOUBLEBUF)   Screen initialization flags
FULLSCREEN = UINT2NUM(SDL_FULLSCREEN)
OPENGL = UINT2NUM(SDL_OPENGL)
OPENGLBLIT = UINT2NUM(SDL_OPENGLBLIT)
RESIZABLE = UINT2NUM(SDL_RESIZABLE)
NOFRAME = UINT2NUM(SDL_NOFRAME)
NOEVENT = UINT2NUM(SDL_NOEVENT)   Event constants
ACTIVEEVENT = UINT2NUM(SDL_ACTIVEEVENT)
KEYDOWN = UINT2NUM(SDL_KEYDOWN)
KEYUP = UINT2NUM(SDL_KEYUP)
MOUSEMOTION = UINT2NUM(SDL_MOUSEMOTION)
MOUSEBUTTONDOWN = UINT2NUM(SDL_MOUSEBUTTONDOWN)
MOUSEBUTTONUP = UINT2NUM(SDL_MOUSEBUTTONUP)
JOYAXISMOTION = UINT2NUM(SDL_JOYAXISMOTION)
JOYBALLMOTION = UINT2NUM(SDL_JOYBALLMOTION)
JOYHATMOTION = UINT2NUM(SDL_JOYHATMOTION)
JOYBUTTONDOWN = UINT2NUM(SDL_JOYBUTTONDOWN)
JOYBUTTONUP = UINT2NUM(SDL_JOYBUTTONUP)
QUIT = UINT2NUM(SDL_QUIT)
SYSWMEVENT = UINT2NUM(SDL_SYSWMEVENT)
VIDEORESIZE = UINT2NUM(SDL_VIDEORESIZE)
VIDEOEXPOSE = UINT2NUM(SDL_VIDEOEXPOSE)
USEREVENT = UINT2NUM(SDL_USEREVENT)
HAT_CENTERED = UINT2NUM(SDL_HAT_CENTERED)   Joystick constants
HAT_UP = UINT2NUM(SDL_HAT_UP)
HAT_RIGHT = UINT2NUM(SDL_HAT_RIGHT)
HAT_DOWN = UINT2NUM(SDL_HAT_DOWN)
HAT_LEFT = UINT2NUM(SDL_HAT_LEFT)
HAT_RIGHTUP = UINT2NUM(SDL_HAT_RIGHTUP)
HAT_RIGHTDOWN = UINT2NUM(SDL_HAT_RIGHTDOWN)
HAT_LEFTUP = UINT2NUM(SDL_HAT_LEFTUP)
HAT_LEFTDOWN = UINT2NUM(SDL_HAT_LEFTDOWN)
MOUSE_LEFT = UINT2NUM(SDL_BUTTON_LEFT)   Mouse constants
MOUSE_MIDDLE = UINT2NUM(SDL_BUTTON_MIDDLE)
MOUSE_RIGHT = UINT2NUM(SDL_BUTTON_RIGHT)
MOUSE_LMASK = UINT2NUM(SDL_BUTTON_LMASK)
MOUSE_MMASK = UINT2NUM(SDL_BUTTON_MMASK)
MOUSE_RMASK = UINT2NUM(SDL_BUTTON_RMASK)
K_UNKNOWN = UINT2NUM(SDLK_UNKNOWN)   ASCII key symbols
K_FIRST = UINT2NUM(SDLK_FIRST)
K_BACKSPACE = UINT2NUM(SDLK_BACKSPACE)
K_TAB = UINT2NUM(SDLK_TAB)
K_CLEAR = UINT2NUM(SDLK_CLEAR)
K_RETURN = UINT2NUM(SDLK_RETURN)
K_PAUSE = UINT2NUM(SDLK_PAUSE)
K_ESCAPE = UINT2NUM(SDLK_ESCAPE)
K_SPACE = UINT2NUM(SDLK_SPACE)
K_EXCLAIM = UINT2NUM(SDLK_EXCLAIM)
K_QUOTEDBL = UINT2NUM(SDLK_QUOTEDBL)
K_HASH = UINT2NUM(SDLK_HASH)
K_DOLLAR = UINT2NUM(SDLK_DOLLAR)
K_AMPERSAND = UINT2NUM(SDLK_AMPERSAND)
K_QUOTE = UINT2NUM(SDLK_QUOTE)
K_LEFTPAREN = UINT2NUM(SDLK_LEFTPAREN)
K_RIGHTPAREN = UINT2NUM(SDLK_RIGHTPAREN)
K_ASTERISK = UINT2NUM(SDLK_ASTERISK)
K_PLUS = UINT2NUM(SDLK_PLUS)
K_COMMA = UINT2NUM(SDLK_COMMA)
K_MINUS = UINT2NUM(SDLK_MINUS)
K_PERIOD = UINT2NUM(SDLK_PERIOD)
K_SLASH = UINT2NUM(SDLK_SLASH)
K_0 = UINT2NUM(SDLK_0)
K_1 = UINT2NUM(SDLK_1)
K_2 = UINT2NUM(SDLK_2)
K_3 = UINT2NUM(SDLK_3)
K_4 = UINT2NUM(SDLK_4)
K_5 = UINT2NUM(SDLK_5)
K_6 = UINT2NUM(SDLK_6)
K_7 = UINT2NUM(SDLK_7)
K_8 = UINT2NUM(SDLK_8)
K_9 = UINT2NUM(SDLK_9)
K_COLON = UINT2NUM(SDLK_COLON)
K_SEMICOLON = UINT2NUM(SDLK_SEMICOLON)
K_LESS = UINT2NUM(SDLK_LESS)
K_EQUALS = UINT2NUM(SDLK_EQUALS)
K_GREATER = UINT2NUM(SDLK_GREATER)
K_QUESTION = UINT2NUM(SDLK_QUESTION)
K_AT = UINT2NUM(SDLK_AT)
K_LEFTBRACKET = UINT2NUM(SDLK_LEFTBRACKET)
K_BACKSLASH = UINT2NUM(SDLK_BACKSLASH)
K_RIGHTBRACKET = UINT2NUM(SDLK_RIGHTBRACKET)
K_CARET = UINT2NUM(SDLK_CARET)
K_UNDERSCORE = UINT2NUM(SDLK_UNDERSCORE)
K_BACKQUOTE = UINT2NUM(SDLK_BACKQUOTE)
K_A = UINT2NUM(SDLK_a)
K_B = UINT2NUM(SDLK_b)
K_C = UINT2NUM(SDLK_c)
K_D = UINT2NUM(SDLK_d)
K_E = UINT2NUM(SDLK_e)
K_F = UINT2NUM(SDLK_f)
K_G = UINT2NUM(SDLK_g)
K_H = UINT2NUM(SDLK_h)
K_I = UINT2NUM(SDLK_i)
K_J = UINT2NUM(SDLK_j)
K_K = UINT2NUM(SDLK_k)
K_L = UINT2NUM(SDLK_l)
K_M = UINT2NUM(SDLK_m)
K_N = UINT2NUM(SDLK_n)
K_O = UINT2NUM(SDLK_o)
K_P = UINT2NUM(SDLK_p)
K_Q = UINT2NUM(SDLK_q)
K_R = UINT2NUM(SDLK_r)
K_S = UINT2NUM(SDLK_s)
K_T = UINT2NUM(SDLK_t)
K_U = UINT2NUM(SDLK_u)
K_V = UINT2NUM(SDLK_v)
K_W = UINT2NUM(SDLK_w)
K_X = UINT2NUM(SDLK_x)
K_Y = UINT2NUM(SDLK_y)
K_Z = UINT2NUM(SDLK_z)
K_DELETE = UINT2NUM(SDLK_DELETE)
K_WORLD_0 = UINT2NUM(SDLK_WORLD_0)   International keyboard symbols
K_WORLD_1 = UINT2NUM(SDLK_WORLD_1)
K_WORLD_2 = UINT2NUM(SDLK_WORLD_2)
K_WORLD_3 = UINT2NUM(SDLK_WORLD_3)
K_WORLD_4 = UINT2NUM(SDLK_WORLD_4)
K_WORLD_5 = UINT2NUM(SDLK_WORLD_5)
K_WORLD_6 = UINT2NUM(SDLK_WORLD_6)
K_WORLD_7 = UINT2NUM(SDLK_WORLD_7)
K_WORLD_8 = UINT2NUM(SDLK_WORLD_8)
K_WORLD_9 = UINT2NUM(SDLK_WORLD_9)
K_WORLD_10 = UINT2NUM(SDLK_WORLD_10)
K_WORLD_11 = UINT2NUM(SDLK_WORLD_11)
K_WORLD_12 = UINT2NUM(SDLK_WORLD_12)
K_WORLD_13 = UINT2NUM(SDLK_WORLD_13)
K_WORLD_14 = UINT2NUM(SDLK_WORLD_14)
K_WORLD_15 = UINT2NUM(SDLK_WORLD_15)
K_WORLD_16 = UINT2NUM(SDLK_WORLD_16)
K_WORLD_17 = UINT2NUM(SDLK_WORLD_17)
K_WORLD_18 = UINT2NUM(SDLK_WORLD_18)
K_WORLD_19 = UINT2NUM(SDLK_WORLD_19)
K_WORLD_20 = UINT2NUM(SDLK_WORLD_20)
K_WORLD_21 = UINT2NUM(SDLK_WORLD_21)
K_WORLD_22 = UINT2NUM(SDLK_WORLD_22)
K_WORLD_23 = UINT2NUM(SDLK_WORLD_23)
K_WORLD_24 = UINT2NUM(SDLK_WORLD_24)
K_WORLD_25 = UINT2NUM(SDLK_WORLD_25)
K_WORLD_26 = UINT2NUM(SDLK_WORLD_26)
K_WORLD_27 = UINT2NUM(SDLK_WORLD_27)
K_WORLD_28 = UINT2NUM(SDLK_WORLD_28)
K_WORLD_29 = UINT2NUM(SDLK_WORLD_29)
K_WORLD_30 = UINT2NUM(SDLK_WORLD_30)
K_WORLD_31 = UINT2NUM(SDLK_WORLD_31)
K_WORLD_32 = UINT2NUM(SDLK_WORLD_32)
K_WORLD_33 = UINT2NUM(SDLK_WORLD_33)
K_WORLD_34 = UINT2NUM(SDLK_WORLD_34)
K_WORLD_35 = UINT2NUM(SDLK_WORLD_35)
K_WORLD_36 = UINT2NUM(SDLK_WORLD_36)
K_WORLD_37 = UINT2NUM(SDLK_WORLD_37)
K_WORLD_38 = UINT2NUM(SDLK_WORLD_38)
K_WORLD_39 = UINT2NUM(SDLK_WORLD_39)
K_WORLD_40 = UINT2NUM(SDLK_WORLD_40)
K_WORLD_41 = UINT2NUM(SDLK_WORLD_41)
K_WORLD_42 = UINT2NUM(SDLK_WORLD_42)
K_WORLD_43 = UINT2NUM(SDLK_WORLD_43)
K_WORLD_44 = UINT2NUM(SDLK_WORLD_44)
K_WORLD_45 = UINT2NUM(SDLK_WORLD_45)
K_WORLD_46 = UINT2NUM(SDLK_WORLD_46)
K_WORLD_47 = UINT2NUM(SDLK_WORLD_47)
K_WORLD_48 = UINT2NUM(SDLK_WORLD_48)
K_WORLD_49 = UINT2NUM(SDLK_WORLD_49)
K_WORLD_50 = UINT2NUM(SDLK_WORLD_50)
K_WORLD_51 = UINT2NUM(SDLK_WORLD_51)
K_WORLD_52 = UINT2NUM(SDLK_WORLD_52)
K_WORLD_53 = UINT2NUM(SDLK_WORLD_53)
K_WORLD_54 = UINT2NUM(SDLK_WORLD_54)
K_WORLD_55 = UINT2NUM(SDLK_WORLD_55)
K_WORLD_56 = UINT2NUM(SDLK_WORLD_56)
K_WORLD_57 = UINT2NUM(SDLK_WORLD_57)
K_WORLD_58 = UINT2NUM(SDLK_WORLD_58)
K_WORLD_59 = UINT2NUM(SDLK_WORLD_59)
K_WORLD_60 = UINT2NUM(SDLK_WORLD_60)
K_WORLD_61 = UINT2NUM(SDLK_WORLD_61)
K_WORLD_62 = UINT2NUM(SDLK_WORLD_62)
K_WORLD_63 = UINT2NUM(SDLK_WORLD_63)
K_WORLD_64 = UINT2NUM(SDLK_WORLD_64)
K_WORLD_65 = UINT2NUM(SDLK_WORLD_65)
K_WORLD_66 = UINT2NUM(SDLK_WORLD_66)
K_WORLD_67 = UINT2NUM(SDLK_WORLD_67)
K_WORLD_68 = UINT2NUM(SDLK_WORLD_68)
K_WORLD_69 = UINT2NUM(SDLK_WORLD_69)
K_WORLD_70 = UINT2NUM(SDLK_WORLD_70)
K_WORLD_71 = UINT2NUM(SDLK_WORLD_71)
K_WORLD_72 = UINT2NUM(SDLK_WORLD_72)
K_WORLD_73 = UINT2NUM(SDLK_WORLD_73)
K_WORLD_74 = UINT2NUM(SDLK_WORLD_74)
K_WORLD_75 = UINT2NUM(SDLK_WORLD_75)
K_WORLD_76 = UINT2NUM(SDLK_WORLD_76)
K_WORLD_77 = UINT2NUM(SDLK_WORLD_77)
K_WORLD_78 = UINT2NUM(SDLK_WORLD_78)
K_WORLD_79 = UINT2NUM(SDLK_WORLD_79)
K_WORLD_80 = UINT2NUM(SDLK_WORLD_80)
K_WORLD_81 = UINT2NUM(SDLK_WORLD_81)
K_WORLD_82 = UINT2NUM(SDLK_WORLD_82)
K_WORLD_83 = UINT2NUM(SDLK_WORLD_83)
K_WORLD_84 = UINT2NUM(SDLK_WORLD_84)
K_WORLD_85 = UINT2NUM(SDLK_WORLD_85)
K_WORLD_86 = UINT2NUM(SDLK_WORLD_86)
K_WORLD_87 = UINT2NUM(SDLK_WORLD_87)
K_WORLD_88 = UINT2NUM(SDLK_WORLD_88)
K_WORLD_89 = UINT2NUM(SDLK_WORLD_89)
K_WORLD_90 = UINT2NUM(SDLK_WORLD_90)
K_WORLD_91 = UINT2NUM(SDLK_WORLD_91)
K_WORLD_92 = UINT2NUM(SDLK_WORLD_92)
K_WORLD_93 = UINT2NUM(SDLK_WORLD_93)
K_WORLD_94 = UINT2NUM(SDLK_WORLD_94)
K_WORLD_95 = UINT2NUM(SDLK_WORLD_95)
K_KP0 = UINT2NUM(SDLK_KP0)   Numeric keypad symbols
K_KP1 = UINT2NUM(SDLK_KP1)
K_KP2 = UINT2NUM(SDLK_KP2)
K_KP3 = UINT2NUM(SDLK_KP3)
K_KP4 = UINT2NUM(SDLK_KP4)
K_KP5 = UINT2NUM(SDLK_KP5)
K_KP6 = UINT2NUM(SDLK_KP6)
K_KP7 = UINT2NUM(SDLK_KP7)
K_KP8 = UINT2NUM(SDLK_KP8)
K_KP9 = UINT2NUM(SDLK_KP9)
K_KP_PERIOD = UINT2NUM(SDLK_KP_PERIOD)
K_KP_DIVIDE = UINT2NUM(SDLK_KP_DIVIDE)
K_KP_MULTIPLY = UINT2NUM(SDLK_KP_MULTIPLY)
K_KP_MINUS = UINT2NUM(SDLK_KP_MINUS)
K_KP_PLUS = UINT2NUM(SDLK_KP_PLUS)
K_KP_ENTER = UINT2NUM(SDLK_KP_ENTER)
K_KP_EQUALS = UINT2NUM(SDLK_KP_EQUALS)
K_UP = UINT2NUM(SDLK_UP)   Arrows + Home/End pad
K_DOWN = UINT2NUM(SDLK_DOWN)
K_RIGHT = UINT2NUM(SDLK_RIGHT)
K_LEFT = UINT2NUM(SDLK_LEFT)
K_INSERT = UINT2NUM(SDLK_INSERT)
K_HOME = UINT2NUM(SDLK_HOME)
K_END = UINT2NUM(SDLK_END)
K_PAGEUP = UINT2NUM(SDLK_PAGEUP)
K_PAGEDOWN = UINT2NUM(SDLK_PAGEDOWN)
K_F1 = UINT2NUM(SDLK_F1)   Function keys
K_F2 = UINT2NUM(SDLK_F2)
K_F3 = UINT2NUM(SDLK_F3)
K_F4 = UINT2NUM(SDLK_F4)
K_F5 = UINT2NUM(SDLK_F5)
K_F6 = UINT2NUM(SDLK_F6)
K_F7 = UINT2NUM(SDLK_F7)
K_F8 = UINT2NUM(SDLK_F8)
K_F9 = UINT2NUM(SDLK_F9)
K_F10 = UINT2NUM(SDLK_F10)
K_F11 = UINT2NUM(SDLK_F11)
K_F12 = UINT2NUM(SDLK_F12)
K_F13 = UINT2NUM(SDLK_F13)
K_F14 = UINT2NUM(SDLK_F14)
K_F15 = UINT2NUM(SDLK_F15)
K_NUMLOCK = UINT2NUM(SDLK_NUMLOCK)   Key state modifier keys
K_CAPSLOCK = UINT2NUM(SDLK_CAPSLOCK)
K_SCROLLOCK = UINT2NUM(SDLK_SCROLLOCK)
K_RSHIFT = UINT2NUM(SDLK_RSHIFT)
K_LSHIFT = UINT2NUM(SDLK_LSHIFT)
K_RCTRL = UINT2NUM(SDLK_RCTRL)
K_LCTRL = UINT2NUM(SDLK_LCTRL)
K_RALT = UINT2NUM(SDLK_RALT)
K_LALT = UINT2NUM(SDLK_LALT)
K_RMETA = UINT2NUM(SDLK_RMETA)
K_LMETA = UINT2NUM(SDLK_LMETA)
K_LSUPER = UINT2NUM(SDLK_LSUPER)
K_RSUPER = UINT2NUM(SDLK_RSUPER)
K_MODE = UINT2NUM(SDLK_MODE)
K_HELP = UINT2NUM(SDLK_HELP)   Miscellaneous keys
K_PRINT = UINT2NUM(SDLK_PRINT)
K_SYSREQ = UINT2NUM(SDLK_SYSREQ)
K_BREAK = UINT2NUM(SDLK_BREAK)
K_MENU = UINT2NUM(SDLK_MENU)
K_POWER = UINT2NUM(SDLK_POWER)
K_EURO = UINT2NUM(SDLK_EURO)
K_LAST = UINT2NUM(SDLK_LAST)
K_MOD_NONE = UINT2NUM(KMOD_NONE)
K_MOD_LSHIFT = UINT2NUM(KMOD_LSHIFT)
K_MOD_RSHIFT = UINT2NUM(KMOD_RSHIFT)
K_MOD_LCTRL = UINT2NUM(KMOD_LCTRL)
K_MOD_RCTRL = UINT2NUM(KMOD_RCTRL)
K_MOD_LALT = UINT2NUM(KMOD_LALT)
K_MOD_RALT = UINT2NUM(KMOD_RALT)
K_MOD_LMETA = UINT2NUM(KMOD_LMETA)
K_MOD_RMETA = UINT2NUM(KMOD_RMETA)
K_MOD_NUM = UINT2NUM(KMOD_NUM)
K_MOD_CAPS = UINT2NUM(KMOD_CAPS)
K_MOD_MODE = UINT2NUM(KMOD_MODE)
K_MOD_RESERVED = UINT2NUM(KMOD_RESERVED)
K_MOD_CTRL = UINT2NUM(KMOD_CTRL)
K_MOD_SHIFT = UINT2NUM(KMOD_SHIFT)
K_MOD_ALT = UINT2NUM(KMOD_ALT)
K_MOD_META = UINT2NUM(KMOD_META)
SDL_EVENTS = [ActiveEvent, KeyDownEvent, KeyUpEvent,\ MouseMotionEvent,MouseDownEvent,MouseUpEvent,JoyAxisEvent,\ JoyBallEvent, JoyHatEvent,JoyDownEvent, JoyUpEvent,\ ResizeEvent, QuitEvent]   List of all Rubygame hardware event classes. *Do not modify!*

Public Class methods

Returns the name of the audio driver that SDL is using.

May raise an SDLError if initialization fails.

[Source]

/* call-seq:
 *  audio_driver -> string 
 *
 *  Returns the name of the audio driver that SDL is using.
 *
 *  May raise an SDLError if initialization fails.
 */

VALUE rbgm_mixer_audiodriver(VALUE module)
{
  if( ensure_open_audio() != 0 )
  {
    rb_raise(eSDLError, "Could not initialize audio: %s", Mix_GetError());
  }

  char driver_name[1024];
  if(SDL_AudioDriverName(driver_name, sizeof(driver_name)) == NULL)
  {     
    rb_raise(eSDLError, "Could not get audio driver name: %s", Mix_GetError());
  }
  return rb_str_new2(driver_name);
}

Deinitializes and closes the audio device. If audio was not open, this method does nothing, and returns false. See also open_audio().

NOTE: The audio will be automatically closed when the program exits. You only need to close audio manually if you want to call open_audio with different settings.

Returns:true if the audio changed from open to closed, or false if the audio was not open before this action.

[Source]

/* call-seq:
 *  close_audio()  ->  true or false
 *
 *  Deinitializes and closes the audio device. If audio was not open,
 *  this method does nothing, and returns false. See also #open_audio().
 *
 *  NOTE: The audio will be automatically closed when the program
 *  exits. You only need to close audio manually if you want to
 *  call #open_audio with different settings.
 *
 *  Returns::  true if the audio changed from open to closed, or
 *             false if the audio was not open before this action.
 */
VALUE rbgm_mixer_closeaudio2(VALUE module)
{
  if( audio_is_open() )
  {
    Mix_CloseAudio();
    return Qtrue;
  }
  else
  {
    return Qfalse;
  }
}

Disable key repeat, undoing the effect of enable_key_repeat.

[Source]

/* 
 *  call-seq:
 *    disable_key_repeat
 *
 *  Disable key repeat, undoing the effect of #enable_key_repeat.
 *
 */
VALUE rg_disable_key_repeat(VALUE module)
{
        int result = SDL_EnableKeyRepeat( 0, 0 );

        if (result != 0) {
                rb_raise(eSDLError, "Could not disable key repeat: %s",
                         SDL_GetError());
        }

        return Qnil;
}

Enable key repeat, so that additional keyboard release and press events are automatically generated for as long as the key is held down. See also disable_key_repeat.

delay:how many seconds to wait before starting to repeat. Default is 0.5 seconds. (Numeric or :default, optional)
interval:how many seconds to wait in between repetitions after the first one. Default is 0.03 seconds. (Numeric or :default, optional)

[Source]

/* 
 *  call-seq:
 *    enable_key_repeat( delay=:default, interval=:default )
 *
 *  Enable key repeat, so that additional keyboard release and press
 *  events are automatically generated for as long as the key is held
 *  down. See also #disable_key_repeat.
 *
 *  delay::    how many seconds to wait before starting to repeat.
 *             Default is 0.5 seconds. (Numeric or :default, optional)
 *
 *  interval:: how many seconds to wait in between repetitions after
 *             the first one. Default is 0.03 seconds. 
 *             (Numeric or :default, optional)
 *
 */
VALUE rg_enable_key_repeat(int argc, VALUE *argv, VALUE module)
{

        VALUE vdelay, vinterval;
        rb_scan_args(argc, argv, "02", &vdelay, &vinterval);


        int delay = rg_get_keyrepeat_value( vdelay,
                                            SDL_DEFAULT_REPEAT_DELAY,
                                            "delay" );

        int interval = rg_get_keyrepeat_value( vinterval,
                                               SDL_DEFAULT_REPEAT_INTERVAL,
                                               "interval" );


        int result = SDL_EnableKeyRepeat( delay, interval );

        if (result != 0) {
                rb_raise(eSDLError, "Could not enable key repeat: %s",
                         SDL_GetError());
        }

        return Qnil;
}

Retrieves all pending events from SDL‘s event stack and converts them into Rubygame Event objects. Returns an Array of all the events, in the order they were read.

This method is used by the EventQueue class, so don‘t call it if you are using EventQueue for event management! If you do, the EventQueue will not receive all the events, because they will have been removed from SDL‘s event stack by this method.

However, if you aren‘t using EventQueue, you can safely use this method to make your own event management system.

[Source]

/* 
 *  call-seq:
 *    fetch_sdl_events -> [Event, ...]
 *
 *  Retrieves all pending events from SDL's event stack and converts them
 *  into Rubygame Event objects. Returns an Array of all the events, in
 *  the order they were read.
 *
 *  This method is used by the EventQueue class, so don't call it if you are
 *  using EventQueue for event management! If you do, the EventQueue will not
 *  receive all the events, because they will have been removed from SDL's
 *  event stack by this method.
 *
 *  However, if you aren't using EventQueue, you can safely use this method
 *  to make your own event management system.
 */
VALUE rbgm_fetchevents(VALUE self)
{
  SDL_Event event;
  VALUE event_array;

  event_array = rb_ary_new();
  /* put each in *event until no pending events are in SDL's queue */
  /* for now, we don't care what type the event in. Filtering comes later */
  while(SDL_PollEvent(&event)==1) 
  {
    rb_ary_push(event_array, rbgm_convert_sdlevent(event) );
  }
  return event_array;
}

Initialize Rubygame. This should be called soon after you require Rubygame, so that everything will work properly.

[Source]

/*
 *  call-seq:
 *     init  ->  nil
 *
 *  Initialize Rubygame. This should be called soon after you +require+
 *  Rubygame, so that everything will work properly.
 */
VALUE rbgm_init(VALUE module)
{
        if(SDL_Init(SDL_INIT_EVERYTHING)==0)
        {
    SDL_EnableUNICODE(1);
                return Qnil;
        }
        else
        {
                rb_raise(eSDLError,"Could not initialize SDL.");
                return Qnil; /* should never get here */
        }
}

Converts a keyboard symbol (keysym) into a human-readable text string. If either Shift key was being pressed, alphanumeric or punctuation keys will be made uppercase or alternate, based on U.S. keyboard layout. E.g. "a" becomes "A", "1" becomes "!", and "/" becomes "?".

[Source]

# File lib/rubygame/event.rb, line 32
        def Rubygame.key2str( sym, mods )
                if (mods.include? K_LSHIFT) or (mods.include? K_RSHIFT)
                        return (Rubygame::Key::KEY2UPPER[sym]\
                                or Rubygame::Key::KEY2ASCII[sym] or "")
                else
                        return (Rubygame::Key::KEY2LOWER[sym]\
                                or Rubygame::Key::KEY2ASCII[sym] or "")
                end
        end

Given the sym of a key, returns a printable representation. This differs from key2str in that this will return a printable string for any key, even non-printable keys such as the arrow keys.

This method may raise SDLError if the SDL video subsystem could not be initialized for some reason.

Example:

  Rubygame.key_name( Rubygame::K_A )       # => "a"
  Rubygame.key_name( Rubygame::K_RETURN )  # => "return"
  Rubygame.key_name( Rubygame::K_LEFT )    # => "left"

[Source]

/* 
 *  call-seq:
 *    key_name(sym) -> string
 *
 *  Given the sym of a key, returns a printable representation.  This
 *  differs from key2str in that this will return a printable string
 *  for any key, even non-printable keys such as the arrow keys.
 *
 *  This method may raise SDLError if the SDL video subsystem could
 *  not be initialized for some reason.
 *
 *  Example:
 *    Rubygame.key_name( Rubygame::K_A )       # => "a"
 *    Rubygame.key_name( Rubygame::K_RETURN )  # => "return"
 *    Rubygame.key_name( Rubygame::K_LEFT )    # => "left"
 */
VALUE rbgm_keyname(VALUE self, VALUE sym)
{
        /* SDL_GetKeyName only works when video system has been initialized. */
        if( init_video_system() == 0 )
        {
                SDLKey key = NUM2INT(sym);
                char *result = SDL_GetKeyName(key);
                return rb_str_new2(result);           
        }
        else
        {
                rb_raise(eSDLError,"Could not initialize SDL video subsystem.");
                return Qnil;
        }
}

Initializes the audio device using the given settings.

NOTE: Audio will be automatically opened when Rubygame::Sound or Rubygame::Music are first used. You only need to open audio manually if you want settings different from the default, or if you are using the older, deprecated Music and Sample classes from the Rubygame::Mixer module.

If audio is already open, this method has no effect, and returns false. If you want to change audio settings, you must close_audio() and then open it again.

options:A Hash of any of the following options. (Hash, optional)
   :frequency::  output sample rate in audio samples per second
                 (Hz). Affects the quality of the sound output, at
                 the expense of CPU usage. If omitted, the default
                 (22050) is used. The default is recommended for
                 most games.

   :channels::   output sound channels. Use 2 for stereo, 1 for mono.
                 If omitted, the default (2) is used.

   :buffer::     size of the sound buffer, in bytes. Must be a
                 power of 2 (e.g. 512, 1024, 2048). If omitted,
                 the default (1024) is used. If your game is
                 fast-paced, you may want to use a smaller value
                 to reduce audio delay, the time between when you
                 play a sound and when it is heard.
Returns:true if the audio was newly opened by this action, or false if it was already open before this action.
May raise:SDLError, if initialization fails. ArgumentError, if an invalid value is given for any option.

[Source]

/* call-seq:
 *  open_audio( options={ :buffer => 1024, :channels => 2, :frequency => 22050 } )  ->  true or false
 *
 *  Initializes the audio device using the given settings.
 *
 *  NOTE: Audio will be automatically opened when Rubygame::Sound or
 *  Rubygame::Music are first used. You only need to open audio
 *  manually if you want settings different from the default, or if
 *  you are using the older, deprecated Music and Sample classes from
 *  the Rubygame::Mixer module.
 *
 *  If audio is already open, this method has no effect, and returns false.
 *  If you want to change audio settings, you must #close_audio() and
 *  then open it again.
 *
 *  options::    A Hash of any of the following options. (Hash, optional)
 *
 *     :frequency::  output sample rate in audio samples per second
 *                   (Hz). Affects the quality of the sound output, at
 *                   the expense of CPU usage. If omitted, the default
 *                   (22050) is used. The default is recommended for
 *                   most games.
 *
 *     :channels::   output sound channels. Use 2 for stereo, 1 for mono.
 *                   If omitted, the default (2) is used.
 *
 *     :buffer::     size of the sound buffer, in bytes. Must be a
 *                   power of 2 (e.g. 512, 1024, 2048). If omitted,
 *                   the default (1024) is used. If your game is
 *                   fast-paced, you may want to use a smaller value
 *                   to reduce audio delay, the time between when you
 *                   play a sound and when it is heard.
 *
 *  Returns::    true if the audio was newly opened by this action, or
 *               false if it was already open before this action.
 *
 *  May raise::  SDLError, if initialization fails.
 *               ArgumentError, if an invalid value is given for any option.
 *
 *
 */
VALUE rbgm_mixer_openaudio2(int argc, VALUE *argv, VALUE module)
{
  VALUE options;

  int buffer = 1024;
  int channels = 2;
  int frequency = MIX_DEFAULT_FREQUENCY;

  /* In general, format should always be the default. */
  Uint16 format = MIX_DEFAULT_FORMAT;


  /* Does nothing if audio is already open. */
  if( audio_is_open() )
  {
    return Qfalse;
  }


  rb_scan_args(argc, argv, "01", &options);


  if( RTEST(options) )
  {
    /* Make sure options is a Hash table */
    if( TYPE(options) != T_HASH )
    {
      rb_raise(rb_eTypeError, "wrong argument type %s (expected Hash)",
               rb_obj_classname(options));
    }

    VALUE temp;

    /* Buffer size */
    temp = rb_hash_aref(options, make_symbol("buffer"));
    if( RTEST(temp) )
    {
      buffer = NUM2INT(temp);

      if( buffer <= 0 )
      {
        rb_raise(rb_eArgError, "buffer size must be positive (got %d)", buffer);
      }

      /* Check to see if it's not a power of two */
      if( buffer & (buffer - 1) != 0 )
      {
        rb_raise(rb_eArgError, "buffer size must be a power of 2 (e.g. 512, 1024) (got %d)", buffer);
      }
    }

    /* Channels */
    temp = rb_hash_aref(options, make_symbol("channels"));
    if( RTEST(temp) )
    {
      channels = NUM2INT(temp);

      if( channels != 1 && channels != 2 )
      {
        rb_raise(rb_eArgError, "channels must be 1 (mono) or 2 (stereo) (got %d)", channels);
      }
    }

    /* Frequency */
    temp = rb_hash_aref(options, make_symbol("frequency"));
    if( RTEST(temp) )
    {
      frequency = NUM2INT(temp);

      if( frequency <= 0 )
      {
        rb_raise(rb_eArgError, "frequency must be positive (got %d)", frequency);
      }
    }
  }

  int result = Mix_OpenAudio(frequency, format, channels, buffer);

  if( result < 0 )
  {
    rb_raise(eSDLError, "Could not open audio: %s", Mix_GetError());
  }

  return Qtrue;
}

Quit Rubygame. This should be used before your program terminates, especially if you have been using a fullscreen Screen! (Otherwise, the desktop resolution might not revert to its previous setting on some platforms, and your users will be frustrated and confused!)

[Source]

/*
 *  call-seq:
 *     quit  ->  nil
 *
 *  Quit Rubygame. This should be used before your program terminates,
 *  especially if you have been using a fullscreen Screen! (Otherwise,
 *  the desktop resolution might not revert to its previous setting on
 *  some platforms, and your users will be frustrated and confused!)
 */
VALUE rbgm_quit(VALUE module)
{
        SDL_Quit();
        return Qnil;
}

[Validate]