SDL_EGLIntArrayCallback

Type Alias SDL_EGLIntArrayCallback 

Source
pub type SDL_EGLIntArrayCallback = Option<unsafe extern "C" fn(userdata: *mut c_void, display: SDL_EGLDisplay, config: SDL_EGLConfig) -> *mut SDL_EGLint>;
Expand description

EGL surface/context attribute initialization callback types.

This is called when SDL is attempting to create an EGL surface, to let the app add extra attributes to its eglCreateWindowSurface() or eglCreateContext calls.

For convenience, the EGLDisplay and EGLConfig to use are provided to the callback.

The callback should return a pointer to an EGL attribute array terminated with EGL_NONE. If this function returns NULL, the SDL_CreateWindow process will fail gracefully.

The returned pointer should be allocated with SDL_malloc() and will be passed to SDL_free().

The arrays returned by each callback will be appended to the existing attribute arrays defined by SDL.

§Parameters

  • userdata: an app-controlled pointer that is passed to the callback.
  • display: the EGL display to be used.
  • config: the EGL config to be used.

§Return value

Returns a newly-allocated array of attributes, terminated with EGL_NONE.

§Availability

This datatype is available since SDL 3.2.0.

§See also

Aliased Type§

pub enum SDL_EGLIntArrayCallback {
    None,
    Some(unsafe extern "C" fn(*mut c_void, *mut c_void, *mut c_void) -> *mut i32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*mut c_void, *mut c_void, *mut c_void) -> *mut i32)

Some value of type T.