#include <config.h>
#endif
-#include <assert.h>
-
#include <ApplicationServices/ApplicationServices.h>
#include <FL/Fl_Window.H>
throw rfb::Exception(_("Not enough memory for framebuffer"));
lut = CGColorSpaceCreateDeviceRGB();
- assert(lut);
+ if (!lut)
+ throw rfb::Exception(_("Could not create framebuffer device"));
bitmap = CGBitmapContextCreate(data, width, height, 8, width*4, lut,
kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little);
- assert(bitmap);
-
CGColorSpaceRelease(lut);
+ if (!bitmap)
+ throw rfb::Exception(_("Could not create framebuffer bitmap"));
}
#include <rfb/CMsgWriter.h>
#include <rfb/LogWriter.h>
+#include <rfb/Exception.h>
// FLTK can pull in the X11 headers on some systems
#ifndef XK_VoidSymbol
fb = new X11PixelBuffer(w, h);
#endif
} catch (rdr::Exception& e) {
+ vlog.error(_("Unable to create platform specific framebuffer: %s"), e.str());
+ vlog.error(_("Using platform independent framebuffer"));
fb = new FLTKPixelBuffer(w, h);
}
#include <config.h>
#endif
-#include <assert.h>
#include <stdlib.h>
#include <FL/x.H>
if (!setupShm()) {
xim = XCreateImage(fl_display, fl_visual->visual, fl_visual->depth,
ZPixmap, 0, 0, width, height, BitmapPad(fl_display), 0);
- assert(xim);
+ if (!xim)
+ throw rfb::Exception(_("Could not create framebuffer image"));
xim->data = (char*)malloc(xim->bytes_per_line * xim->height);
- assert(xim->data);
+ if (!xim->data)
+ throw rfb::Exception(_("Not enough memory for framebuffer"));
}
data = (rdr::U8*)xim->data;