+typedef std::map<unsigned long long, glws::Drawable *> DrawableMap;
+typedef std::map<unsigned long long, glws::Context *> ContextMap;
+static DrawableMap drawable_map;
+static DrawableMap pbuffer_map;
+static ContextMap context_map;
+
+
+static glws::Drawable *
+getDrawable(unsigned long long hdc) {
+ if (hdc == 0) {
+ return NULL;
+ }
+
+ DrawableMap::const_iterator it;
+ it = drawable_map.find(hdc);
+ if (it == drawable_map.end()) {
+ return (drawable_map[hdc] = ws->createDrawable(visual));
+ }
+
+ return it->second;
+}
+