aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/x11/mod.rs8
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 = {