Class: Rug::Layer
- Inherits:
-
Object
- Object
- Rug::Layer
- Defined in:
- ext/rug_layer.c
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.new ⇒ Object
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
#clear ⇒ Object
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; } |
#draw ⇒ Object
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;
}
|