diff options
Diffstat (limited to 'layer.cpp')
-rw-r--r-- | layer.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -4,8 +4,18 @@ #include <SDL.h> #include "osc_graphics.h" +#include "osc_server.h" #include "layer.h" +Layer::Layer(const char *name) +{ + mutex = SDL_CreateMutex(); + Layer::name = strdup(name); + + geo_osc_id = register_method("geo", GEO_TYPES, geo_osc); + alpha_osc_id = register_method("alpha", "f", alpha_osc); +} + void LayerList::insert(int pos, Layer *layer) { @@ -58,3 +68,12 @@ LayerList::render(SDL_Surface *target) unlock(); } + +Layer::~Layer() +{ + unregister_method(alpha_osc_id); + unregister_method(geo_osc_id); + + free(name); + SDL_DestroyMutex(mutex); +} |