Class: Rug::Layer

Inherits:
Object
  • Object
show all
Defined in:
ext/rug_layer.c

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.newObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'ext/rug_layer.c', line 18

static VALUE RugInit(VALUE class){
  if (mainWnd == NULL){
    return Qnil;
  }

  RugLayer * rLayer = ALLOC(RugLayer);

  rLayer->layer = SDL_CreateRGBSurface(SDL_HWSURFACE, mainWnd->w, mainWnd->h, mainWnd->format->BitsPerPixel, 0, 0, 0, 0);

  // make the surface transparent
  ClearLayer(rLayer);

  return Data_Wrap_Struct(cRugLayer, NULL, unload_layer, rLayer);
}

Instance Method Details

#clearObject



40
41
42
43
44
45
# File 'ext/rug_layer.c', line 40

static VALUE RugClearLayer(VALUE self){
  RugLayer * rLayer;
  Data_Get_Struct(self, RugLayer, rLayer);
  ClearLayer(rLayer);
  return Qnil;
}

#drawObject



33
34
35
36
37
38
# File 'ext/rug_layer.c', line 33

static VALUE RugDrawLayer(VALUE self){
  RugLayer * rLayer;
  Data_Get_Struct(self, RugLayer, rLayer);
  SDL_BlitSurface(rLayer->layer, NULL, mainWnd, NULL);
  return Qnil;
}