WM: Fix crash when a new window can't be created

Report an error instead of crashing if a new window can't be created
(typically caused by bad drivers).
This commit is contained in:
2015-10-07 00:27:27 +11:00
parent 867c49b962
commit 8471362987
11 changed files with 151 additions and 52 deletions

View File

@@ -87,18 +87,19 @@ void WM_init_splash (struct bContext *C);
void WM_check (struct bContext *C);
struct wmWindow *WM_window_open (struct bContext *C, const struct rcti *rect);
int WM_window_pixels_x (struct wmWindow *win);
int WM_window_pixels_y (struct wmWindow *win);
bool WM_window_is_fullscreen (struct wmWindow *win);
/* defines for 'type' WM_window_open_temp */
#define WM_WINDOW_RENDER 0
#define WM_WINDOW_USERPREFS 1
// #define WM_WINDOW_FILESEL 2 // UNUSED
enum {
WM_WINDOW_RENDER = 1,
WM_WINDOW_USERPREFS,
// WM_WINDOW_FILESEL // UNUSED
};
void WM_window_open_temp (struct bContext *C, struct rcti *position, int type);
struct wmWindow *WM_window_open(struct bContext *C, const struct rcti *rect);
struct wmWindow *WM_window_open_temp(struct bContext *C, const struct rcti *rect_init, int type);
/* returns true if draw method is triple buffer */
bool WM_is_draw_triple(struct wmWindow *win);