// Configure an array of attribute parameters for 
// glxCreateContextAttribsARB().
Configure an array of attribute parameters for
glxCreateContextAttribsARB().
Configure an array of attribute parameters for glxCreateContextAttribsARB () .
pub fn gen_arb_attribs(&self, settings: &GLContextSettings) -> [c_int; 11] {
        let &GLContextSettings {
            version, robust_access, debug, forward_compatible, profile, ..
        } = settings;
        #[allow(non_snake_case)]
        let &GlxExt {
            GLX_ARB_create_context_profile,
            GLX_ARB_create_context_robustness,
            GLX_EXT_create_context_es_profile,
            ..
        } = &self.ext;
        let GLVersion { major, minor, variant } = version;
        let flags = if debug { 
            GLX_CONTEXT_DEBUG_BIT_ARB
        } else { 0 }
        | if forward_compatible {
            GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
        } else { 0 }
        | if robust_access.is_some() && GLX_ARB_create_context_robustness {
            GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB
        } else { 0 };
        let profile_param = match variant {
            GLVariant::Desktop if GLX_ARB_create_context_profile =>
                GLX_CONTEXT_PROFILE_MASK_ARB,
            GLVariant::ES if GLX_EXT_create_context_es_profile =>
                GLX_CONTEXT_PROFILE_MASK_ARB,
            _ => 0,
        };
        let profile_mask = match variant {
            GLVariant::ES => GLX_CONTEXT_ES_PROFILE_BIT_EXT,
            GLVariant::Desktop => match profile {
                GLProfile::Core => GLX_CONTEXT_CORE_PROFILE_BIT_ARB,
                GLProfile::Compatibility => GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
            },
        };
        let robust_param = if robust_access.is_some() {
            GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
        } else { 0 };
        let robust_value = match robust_access {
            None => 0,
            Some(GLContextResetNotificationStrategy::NoResetNotification) =>
                    GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB,
            Some(GLContextResetNotificationStrategy::LoseContextOnReset) =>
                    GLX_LOSE_CONTEXT_ON_RESET_ARB,
        };
        let mut out = [
            GLX_CONTEXT_MAJOR_VERSION_ARB, major as _,
            GLX_CONTEXT_MINOR_VERSION_ARB, minor as _,
            GLX_CONTEXT_FLAGS_ARB, flags,
            0 /* profile_param */, 0 /* profile_mask */,
            0 /* robust_param */, 0 /* robust_value */,
            0
        ];
        let mut i = out.len()-5;
        if profile_param != 0 {
            out[i] = profile_param;
            out[i+1] = profile_mask;
            i += 2;
        }
        if robust_param != 0 {
            out[i] = robust_param;
            out[i+1] = robust_value;
        }
        out
    }
pub fn gen_arb_attribs ( & self , settings : & GLContextSettings ) -> [ c_int ; 11 ] { let & GLContextSettings { version , robust_access , debug , forward_compatible , profile , .. } = settings ; # [ allow ( non_snake_case ) ] let & GlxExt { GLX_ARB_create_context_profile , GLX_ARB_create_context_robustness , GLX_EXT_create_context_es_profile , .. } = & self . ext ; let GLVersion { major , minor , variant } = version ; let flags = if debug { GLX_CONTEXT_DEBUG_BIT_ARB } else { 0 } | if forward_compatible { GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB } else { 0 } | if robust_access . is_some ( ) && GLX_ARB_create_context_robustness { GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB } else { 0 } ; let profile_param = match variant { GLVariant :: Desktop if GLX_ARB_create_context_profile => GLX_CONTEXT_PROFILE_MASK_ARB , GLVariant :: ES if GLX_EXT_create_context_es_profile => GLX_CONTEXT_PROFILE_MASK_ARB , _ => 0 , } ; let profile_mask = match variant { GLVariant :: ES => GLX_CONTEXT_ES_PROFILE_BIT_EXT , GLVariant :: Desktop => match profile { GLProfile :: Core => GLX_CONTEXT_CORE_PROFILE_BIT_ARB , GLProfile :: Compatibility => GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB , } , } ; let robust_param = if robust_access . is_some ( ) { GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB } else { 0 } ; let robust_value = match robust_access { None => 0 , Some ( GLContextResetNotificationStrategy :: NoResetNotification ) => GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB , Some ( GLContextResetNotificationStrategy :: LoseContextOnReset ) => GLX_LOSE_CONTEXT_ON_RESET_ARB , } ; let mut out = [ GLX_CONTEXT_MAJOR_VERSION_ARB , major as _ , GLX_CONTEXT_MINOR_VERSION_ARB , minor as _ , GLX_CONTEXT_FLAGS_ARB , flags , 0 /* profile_param */ , 0 /* profile_mask */ , 0 /* robust_param */ , 0 /* robust_value */ , 0 ] ; let mut i = out . len ( ) - 5 ; if profile_param != 0 { out [ i ] = profile_param ; out [ i + 1 ] = profile_mask ; i += 2 ; } if robust_param != 0 { out [ i ] = robust_param ; out [ i + 1 ] = robust_value ; } out }
Configure an array of attribute parameters for
glxCreateContextAttribsARB().
Configure an array of attribute parameters for glxCreateContextAttribsARB () .
&self
settings
&GLContextSettings