diff options
Diffstat (limited to 'layer_box.cpp')
-rw-r--r-- | layer_box.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/layer_box.cpp b/layer_box.cpp index d229833..0ccaf7c 100644 --- a/layer_box.cpp +++ b/layer_box.cpp @@ -6,6 +6,17 @@ #include "osc_graphics.h" #include "layer_box.h" +LayerBox::LayerBox(const char *name, SDL_Rect geo, float opacity, + SDL_Color color) : Layer(name) +{ + color_osc_id = register_method("color", "iii", + (OscServer::MethodHandlerCb)color_osc); + + LayerBox::geo(geo); + LayerBox::color(color); + LayerBox::alpha(opacity); +} + void LayerBox::geo(SDL_Rect geo) { @@ -27,3 +38,8 @@ LayerBox::frame(SDL_Surface *target) boxRGBA(target, x1, y1, x2 ? : target->w, y2 ? : target->h, r, g, b, a); } + +LayerBox::~LayerBox() +{ + unregister_method(color_osc_id); +} |