+#include <stdexcept>
#ifndef WIN32
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#include <X11/Xutil.h>
#endif
-#include <msp/core/except.h>
#include "display.h"
#include "drawcontext.h"
#include "window.h"
#include "display_priv.h"
+using namespace std;
+
namespace Msp {
namespace Graphics {
window(w)
{
#ifdef WIN32
- throw Exception("DrawContext not supported on win32 yet");
+ throw runtime_error("no DrawContext support on windows");
#else
priv = new Private;
{
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<char *>(shmat(priv->shminfo.shmid, 0, 0));
{
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