Struct khronos_egl::Instance[][src]

pub struct Instance<T> { /* fields omitted */ }
Expand description

EGL API instance.

An instance wraps an interface to the EGL API and provide rust-friendly access to it.

Implementations

Return the number of EGL frame buffer configurations that atch specified attributes.

This will call eglChooseConfig without null as configs to get the number of matching configurations.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Return a list of EGL frame buffer configurations that match specified attributes.

This will write as many matching configurations in configs up to its capacity. You can use the function matching_config_count to get the exact number of configurations matching the specified attributes.

Example
// Get the number of matching configurations.
let count = egl.matching_config_count(display, &attrib_list)?;

// Get the matching configurations.
let mut configs = Vec::with_capacity(count);
egl.choose_config(display, &attrib_list, &mut configs)?;

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Return the first EGL frame buffer configuration that match specified attributes.

This is an helper function that will call choose_config with a buffer of size 1, which is equivalent to:

let mut configs = Vec::with_capacity(1);
egl.choose_config(display, &attrib_list, &mut configs)?;
configs.first();

Copy EGL surface color buffer to a native pixmap.

Create a new EGL rendering context.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Create a new EGL pixel buffer surface.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Create a new EGL offscreen surface.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Since this function may raise undefined behavior if the display and native pixmap do not belong to the same platform, it is inherently unsafe.

Create a new EGL window surface.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Since this function may raise undefined behavior if the display and native window do not belong to the same platform, it is inherently unsafe.

Destroy an EGL rendering context.

Destroy an EGL surface.

Return information about an EGL frame buffer configuration.

Return the number of all frame buffer configurations.

You can use it to setup the correct capacity for the configurations buffer in get_configs.

Example
let mut configs = Vec::with_capacity(egl.get_config_count(display)?);
egl.get_configs(display, &mut configs);
assert!(configs.len() > 0);

Get the list of all EGL frame buffer configurations for a display.

The configurations are added to the configs buffer, up to the buffer’s capacity. You can use get_config_count to get the total number of available frame buffer configurations, and setup the buffer’s capacity accordingly.

Example
let mut configs = Vec::with_capacity(egl.get_config_count(display)?);
egl.get_configs(display, &mut configs);

Return the display for the current EGL rendering context.

Return the read or draw surface for the current EGL rendering context.

Return an EGL display connection.

Return error information.

Return the error of the last called EGL function in the current thread, or None if the error is set to SUCCESS.

Note that since a call to eglGetError sets the error to SUCCESS, and since this function is automatically called by any wrapper function returning a Result when necessary, this function may only return None from the point of view of a user.

Return a GL or an EGL extension function.

Initialize an EGL display connection.

Attach an EGL rendering context to EGL surfaces.

Return EGL rendering context information.

Return a string describing properties of the EGL client or of an EGL display connection.

Return EGL surface information.

Post EGL surface color buffer to a native window.

Terminate an EGL display connection.

Complete GL execution prior to subsequent native rendering calls.

Complete native execution prior to subsequent GL rendering calls.

Defines a two-dimensional texture image.

Releases a color buffer that is being used as a texture.

Set an EGL surface attribute.

Specifies the minimum number of video frame periods per buffer swap for the window associated with the current context.

Set the current rendering API.

Query the current rendering API.

Create a new EGL pixel buffer surface bound to an OpenVG image.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with NONE).

Release EGL per-thread state.

Complete client API execution prior to subsequent native rendering calls.

Return the current EGL rendering context.

Create a new EGL sync object.

Note that the constant ATTRIB_NONE which has the type Attrib can be used instead of NONE to terminate the attribute list.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with ATTRIB_NONE).

This function is unsafe: when creating an OpenCL Event Sync Object, passing an invalid event handle in attrib_list may result in undefined behavior up to and including program termination.

Destroy a sync object.

This function is unsafe: if display does not match the display passed to eglCreateSync when sync was created, the behaviour is undefined.

Wait in the client for a sync object to be signalled.

This function is unsafe: if display does not match the Display passed to create_sync when sync was created, the behaviour is undefined.

Return an attribute of a sync object.

This function is unsafe: If display does not match the Display passed to create_sync when sync was created, behaviour is undefined.

Create a new Image object.

Note that the constant ATTRIB_NONE which has the type Attrib can be used instead of NONE to terminate the attribute list.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with ATTRIB_NONE).

Destroy an Image object.

Return an EGL display connection.

Note that the constant ATTRIB_NONE which has the type Attrib can be used instead of NONE to terminate the attribute list.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with ATTRIB_NONE).

Create a new EGL on-screen rendering surface.

Note that the constant ATTRIB_NONE which has the type Attrib can be used instead of NONE to terminate the attribute list.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with ATTRIB_NONE).

Create a new EGL offscreen surface.

Note that the constant ATTRIB_NONE which has the type Attrib can be used instead of NONE to terminate the attribute list.

This will return a BadParameter error if attrib_list is not a valid attributes list (if it does not terminate with ATTRIB_NONE).

Wait in the server for a sync object to be signalled.

This function is unsafe: if display does not match the Display passed to create_sync when sync was created, the behavior is undefined.

Cast the API.

Try to cast the API.

Returns the version of the provided EGL API.

Create an EGL instance using the symbols provided by the given library.

The most recent version of EGL provided by the given library is loaded. You can check what version has actually been loaded using Instance::version, and/or convert to a more recent version using try_into.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Cast the API.

Cast the API.

Create an EGL instance using the symbols provided by the given library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

This is equivalent to DynamicInstance::load_required_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Create an EGL instance using the symbols provided by the given library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

This is equivalent to DynamicInstance::load_required_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Create an EGL instance using the symbols provided by the given library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

This is equivalent to DynamicInstance::load_required_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Create an EGL instance using the symbols provided by the given library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

This is equivalent to DynamicInstance::load_required_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Create an EGL instance using the symbols provided by the given library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

This is equivalent to DynamicInstance::load_required_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Create an EGL instance using the symbols provided by the given library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library. This function fails if the EGL library does not provide the minimum required version given by the type parameter.

This is equivalent to DynamicInstance::load_required_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Create an EGL instance by finding and loading a dynamic library with the given filename.

See Library::new for more details on how the filename argument is used.

On Linux plateforms, the library is loaded with the RTLD_NODELETE flag. See #14 for more details.

Safety

This is fundamentally unsafe since there are no guaranties the input library complies to the EGL API.

Create an EGL instance by finding and loading the libEGL.so.1 or libEGL.so library.

This is equivalent to DynamicInstance::load_from_filename("libEGL.so.1").

Safety

This is fundamentally unsafe since there are no guaranties the found library complies to the EGL API.

Trait Implementations

Formats the value using the given formatter. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.