--- a/src/bitmap.cpp
+++ b/src/bitmap.cpp
@@ -478,6 +478,10 @@
 
 static int setGfxMode( int mode, int x, int y ){
 	int ret = ::set_gfx_mode( mode, x, y, 0, 0 );
+	if ( ::screen == NULL ){
+		cerr << "Could not set graphics mode! (try -w)" << endl;
+		exit(-1);
+	}
 	if ( Bitmap::Screen != NULL ){
 		delete Bitmap::Screen;
 	}
