Module: SDL::Mouse

Defined in:
ext/sdl/sdl.c

Class Method Summary collapse

Class Method Details

.stateObject

// SDL::Mouse methods:



351
352
353
354
355
356
357
358
359
360
361
362
363
# File 'ext/sdl/sdl.c', line 351

static VALUE Mouse_s_state(VALUE mod) {
  UNUSED(mod);

  int x,y;
  Uint8 result = SDL_GetMouseState(&x, &y);

  return rb_ary_new3(5,
                     INT2FIX(x),
                     INT2FIX(y),
                     INT2BOOL(result&SDL_BUTTON_LMASK),
                     INT2BOOL(result&SDL_BUTTON_MMASK),
                     INT2BOOL(result&SDL_BUTTON_RMASK));
}