]> git.tdb.fi Git - libs/gui.git/blobdiff - source/gbase/drawcontext.cpp
OpenGL can now be required as a package on all archs
[libs/gui.git] / source / gbase / drawcontext.cpp
index d3ac4856324811d04059dbf94c919e207ce48f13..86edf56a95a83cd416a92d39edf197cda2782cfb 100644 (file)
@@ -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<unsigned char *>(image->data);
+#endif
+}
+
 void DrawContext::update()
 {
 #ifndef WIN32