X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgbase%2Fdrawcontext.cpp;h=86edf56a95a83cd416a92d39edf197cda2782cfb;hb=9164e74de9dc17c74ee9f3cea21c4d247a3835d9;hp=d3ac4856324811d04059dbf94c919e207ce48f13;hpb=7a4a508629d370c4a79791c7e62fd6f59e8564e9;p=libs%2Fgui.git diff --git a/source/gbase/drawcontext.cpp b/source/gbase/drawcontext.cpp index d3ac485..86edf56 100644 --- a/source/gbase/drawcontext.cpp +++ b/source/gbase/drawcontext.cpp @@ -20,8 +20,7 @@ namespace Graphics { DrawContext::DrawContext(Window &w): display(w.get_display()), - window(w), - image(0) + window(w) { #ifndef WIN32 ::Display *dpy=display.get_display(); @@ -70,6 +69,24 @@ DrawContext::~DrawContext() #endif } +unsigned DrawContext::get_depth() const +{ +#ifdef WIN32 + return 0; +#else + return image->bits_per_pixel; +#endif +} + +unsigned char *DrawContext::get_data() +{ +#ifdef WIN32 + return 0; +#else + return reinterpret_cast(image->data); +#endif +} + void DrawContext::update() { #ifndef WIN32