X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgbase%2Fdrawcontext.cpp;h=03965671306f5f7224f920e9a414abb4a06f126a;hb=7d2b4349289578b8e7f322186a1f251684ddeb01;hp=0f8d44b25539196f69f428ac8497c6fce9a57eb6;hpb=dce7552c5e2f64fcf5f58b0c934bb4a01f6cbcf7;p=libs%2Fgui.git diff --git a/source/gbase/drawcontext.cpp b/source/gbase/drawcontext.cpp index 0f8d44b..0396567 100644 --- a/source/gbase/drawcontext.cpp +++ b/source/gbase/drawcontext.cpp @@ -1,3 +1,4 @@ +#include #ifndef WIN32 #include #include @@ -5,12 +6,13 @@ #include #include #endif -#include #include "display.h" #include "drawcontext.h" #include "window.h" #include "display_priv.h" +using namespace std; + namespace Msp { namespace Graphics { @@ -28,7 +30,7 @@ DrawContext::DrawContext(Window &w): window(w) { #ifdef WIN32 - throw Exception("DrawContext not supported on win32 yet"); + throw runtime_error("no DrawContext support on windows"); #else priv = new Private; @@ -43,7 +45,7 @@ DrawContext::DrawContext(Window &w): { priv->image = XShmCreateImage(dpy, wa.visual, wa.depth, ZPixmap, 0, &priv->shminfo, wa.width, wa.height); if(!priv->image) - throw Exception("Could not create shared memory XImage"); + throw runtime_error("XShmCreateImage"); priv->shminfo.shmid = shmget(IPC_PRIVATE, priv->image->bytes_per_line*priv->image->height, IPC_CREAT|0666); priv->shminfo.shmaddr=priv->image->data = reinterpret_cast(shmat(priv->shminfo.shmid, 0, 0)); @@ -58,7 +60,7 @@ DrawContext::DrawContext(Window &w): { priv->image = XCreateImage(dpy, wa.visual, wa.depth, ZPixmap, 0, 0, wa.width, wa.height, 8, 0); if(!priv->image) - throw Exception("Could not create XImage"); + throw runtime_error("XCreateImage"); priv->image->data = new char[priv->image->bytes_per_line*priv->image->height]; } #endif