/// Chooses the compositor visual info using the same algorithm that the compositor uses.
///
/// FIXME(pcwalton): It would be more robust to actually have the compositor pass the visual.
Chooses the compositor visual info using the same algorithm that the compositor uses.
FIXME(pcwalton): It would be more robust to actually have the compositor pass the visual.
Chooses the compositor visual info using the same algorithm that the compositor uses . FIXME ( pcwalton ) : It would be more robust to actually have the compositor pass the visual .
fn compositor_visual_info(display: *mut Display) -> (*mut XVisualInfo, Option<glx::types::GLXFBConfig>) {
        // If display is null, we'll assume we are going to be rendering
        // in headless mode without X running.
        if display == ptr::null_mut() {
            return (ptr::null_mut(), None);
        }
        unsafe {
            let fbconfig_attributes = [
                glx::DOUBLEBUFFER as i32, 0,
                glx::DRAWABLE_TYPE as i32, glx::PIXMAP_BIT as i32 | glx::WINDOW_BIT as i32,
                glx::BIND_TO_TEXTURE_RGBA_EXT as i32, 1,
                glx::RENDER_TYPE as i32, glx::RGBA_BIT as i32,
                glx::ALPHA_SIZE as i32, 8,
                0
            ];
            let screen = XDefaultScreen(display);
            let mut number_of_configs = 0;
            let configs = glx::ChooseFBConfig(mem::transmute(display),
                                              screen,
                                              fbconfig_attributes.as_ptr(),
                                              &mut number_of_configs);
            NativeCompositingGraphicsContext::get_compatible_configuration(display,
                                                                           configs,
                                                                           number_of_configs)
        }
    }
fn compositor_visual_info ( display : * mut Display ) -> ( * mut XVisualInfo , Option < glx :: types :: GLXFBConfig > ) { // If display is null, we'll assume we are going to be rendering // in headless mode without X running. if display == ptr :: null_mut ( ) { return ( ptr :: null_mut ( ) , None ) ; } unsafe { let fbconfig_attributes = [ glx :: DOUBLEBUFFER as i32 , 0 , glx :: DRAWABLE_TYPE as i32 , glx :: PIXMAP_BIT as i32 | glx :: WINDOW_BIT as i32 , glx :: BIND_TO_TEXTURE_RGBA_EXT as i32 , 1 , glx :: RENDER_TYPE as i32 , glx :: RGBA_BIT as i32 , glx :: ALPHA_SIZE as i32 , 8 , 0 ] ; let screen = XDefaultScreen ( display ) ; let mut number_of_configs = 0 ; let configs = glx :: ChooseFBConfig ( mem :: transmute ( display ) , screen , fbconfig_attributes . as_ptr ( ) , & mut number_of_configs ) ; NativeCompositingGraphicsContext :: get_compatible_configuration ( display , configs , number_of_configs ) } }
Chooses the compositor visual info using the same algorithm that the compositor uses.
Chooses the compositor visual info using the same algorithm that the compositor uses .
display
*mut Display