diff --git a/common/ux-window.cpp b/common/ux-window.cpp index 7a56b5abd6..d4dcf5b7c1 100644 --- a/common/ux-window.cpp +++ b/common/ux-window.cpp @@ -45,6 +45,9 @@ namespace rs2 // Create GUI Windows _win = glfwCreateWindow(_width, _height, _title_str.c_str(), (_fullscreen ? primary : nullptr), nullptr); + if (!_win) + throw std::runtime_error("Could not open OpenGL window, please check your graphic drivers or use the textual SDK tools"); + glfwMakeContextCurrent(_win); ImGui_ImplGlfw_Init(_win, true); diff --git a/examples/example.hpp b/examples/example.hpp index acf5f8e1e7..32c78bfb9e 100644 --- a/examples/example.hpp +++ b/examples/example.hpp @@ -142,6 +142,8 @@ class window { glfwInit(); win = glfwCreateWindow(width, height, title, nullptr, nullptr); + if (!win) + throw std::runtime_error("Could not open OpenGL window, please check your graphic drivers or use the textual SDK tools"); glfwMakeContextCurrent(win); glfwSetWindowUserPointer(win, this); diff --git a/tools/rosbag-inspector/rs-rosbag-inspector.cpp b/tools/rosbag-inspector/rs-rosbag-inspector.cpp index 7eba16cf5c..b50fec5f8b 100644 --- a/tools/rosbag-inspector/rs-rosbag-inspector.cpp +++ b/tools/rosbag-inspector/rs-rosbag-inspector.cpp @@ -44,6 +44,8 @@ class gui_window _first_frame(true), _w(0), _h(0) { + if (!_window) + throw std::runtime_error("Could not open OpenGL window, please check your graphic drivers"); init_window(); } operator bool()