gracefully handle NULL window

This commit is contained in:
David Rose 2004-02-10 17:42:56 +00:00
parent 7b6594acac
commit bb3dd92452
2 changed files with 9 additions and 7 deletions

View File

@ -261,6 +261,8 @@ open_window(const WindowProperties &props, GraphicsPipe *pipe,
GraphicsWindow *win = wf->open_window(props, &_engine, pipe, gsg);
if (win == (GraphicsWindow *)NULL) {
// Oops, couldn't make an actual window.
framework_cat.error()
<< "Unable to create window.\n";
return NULL;
}

View File

@ -115,14 +115,14 @@ open_window(const WindowProperties &props, GraphicsEngine *engine,
if (_window != (GraphicsWindow *)NULL) {
_window->request_properties(props);
set_background_type(_background_type);
}
// Set up a 3-d camera for the window by default.
make_camera();
if (show_frame_rate_meter) {
_frame_rate_meter = new FrameRateMeter("frame_rate_meter");
_frame_rate_meter->setup_layer(_window);
// Set up a 3-d camera for the window by default.
make_camera();
if (show_frame_rate_meter) {
_frame_rate_meter = new FrameRateMeter("frame_rate_meter");
_frame_rate_meter->setup_layer(_window);
}
}
return _window;