diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2014-08-07 18:05:18 +0200 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2014-08-07 18:05:18 +0200 |
commit | cbf07d3190b8ce07b3f6ec08335677240779218e (patch) | |
tree | d5d8a1a179d5ccdbdc3736ec6476b3fe2d2c92d3 /src/x11 | |
parent | d3e3590b84502c0d18228d40d2676cea2247bd02 (diff) | |
download | glutin-cbf07d3190b8ce07b3f6ec08335677240779218e.tar.gz glutin-cbf07d3190b8ce07b3f6ec08335677240779218e.zip |
Add some error detection
Diffstat (limited to 'src/x11')
-rw-r--r-- | src/x11/mod.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/x11/mod.rs b/src/x11/mod.rs index 9103ea2..4088f29 100644 --- a/src/x11/mod.rs +++ b/src/x11/mod.rs @@ -144,7 +144,13 @@ impl Window { // creating the dummy context let dummy_context = ffi::glXCreateContext(display, &visual_infos, ptr::null(), 1); - ffi::glXMakeCurrent(display, window, dummy_context); + if dummy_context.is_null() { + return Err(format!("glXCreateContext failed")); + } + + if ffi::glXMakeCurrent(display, window, dummy_context) == 0 { + return Err(format!("glXMakeCurrent with dummy context failed")); + } // getting the pointer let fn_ptr = { |