mirror of
https://github.com/rust-windowing/winit.git
synced 2026-09-02 23:00:05 -04:00
Remove dummy context creation for X11
This commit is contained in:
@@ -141,19 +141,6 @@ impl Window {
|
|||||||
|
|
||||||
// getting the pointer to glXCreateContextAttribs
|
// getting the pointer to glXCreateContextAttribs
|
||||||
let create_context_attribs = unsafe {
|
let create_context_attribs = unsafe {
|
||||||
// creating the dummy context
|
|
||||||
let dummy_context =
|
|
||||||
ffi::glXCreateContext(display, &visual_infos, ptr::null(), 1);
|
|
||||||
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 = {
|
|
||||||
let mut addr = ffi::glXGetProcAddress(b"glXCreateContextAttribs".as_ptr()
|
let mut addr = ffi::glXGetProcAddress(b"glXCreateContextAttribs".as_ptr()
|
||||||
as *const u8) as *const ();
|
as *const u8) as *const ();
|
||||||
|
|
||||||
@@ -169,13 +156,6 @@ impl Window {
|
|||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
// cleaning up
|
|
||||||
ffi::glXMakeCurrent(ptr::mut_null(), 0, ptr::null());
|
|
||||||
ffi::glXDestroyContext(display, dummy_context);
|
|
||||||
|
|
||||||
fn_ptr
|
|
||||||
};
|
|
||||||
|
|
||||||
// creating IM
|
// creating IM
|
||||||
let im = unsafe {
|
let im = unsafe {
|
||||||
let im = ffi::XOpenIM(display, ptr::null(), ptr::mut_null(), ptr::mut_null());
|
let im = ffi::XOpenIM(display, ptr::null(), ptr::mut_null(), ptr::mut_null());
|
||||||
|
|||||||
Reference in New Issue
Block a user