mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 18:03:56 -04:00
gracefully handle NULL window
This commit is contained in:
parent
7b6594acac
commit
bb3dd92452
@ -261,6 +261,8 @@ open_window(const WindowProperties &props, GraphicsPipe *pipe,
|
|||||||
GraphicsWindow *win = wf->open_window(props, &_engine, pipe, gsg);
|
GraphicsWindow *win = wf->open_window(props, &_engine, pipe, gsg);
|
||||||
if (win == (GraphicsWindow *)NULL) {
|
if (win == (GraphicsWindow *)NULL) {
|
||||||
// Oops, couldn't make an actual window.
|
// Oops, couldn't make an actual window.
|
||||||
|
framework_cat.error()
|
||||||
|
<< "Unable to create window.\n";
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,14 +115,14 @@ open_window(const WindowProperties &props, GraphicsEngine *engine,
|
|||||||
if (_window != (GraphicsWindow *)NULL) {
|
if (_window != (GraphicsWindow *)NULL) {
|
||||||
_window->request_properties(props);
|
_window->request_properties(props);
|
||||||
set_background_type(_background_type);
|
set_background_type(_background_type);
|
||||||
}
|
|
||||||
|
|
||||||
// Set up a 3-d camera for the window by default.
|
// Set up a 3-d camera for the window by default.
|
||||||
make_camera();
|
make_camera();
|
||||||
|
|
||||||
if (show_frame_rate_meter) {
|
if (show_frame_rate_meter) {
|
||||||
_frame_rate_meter = new FrameRateMeter("frame_rate_meter");
|
_frame_rate_meter = new FrameRateMeter("frame_rate_meter");
|
||||||
_frame_rate_meter->setup_layer(_window);
|
_frame_rate_meter->setup_layer(_window);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _window;
|
return _window;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user