pub struct Instance<T> { /* private fields */ }
Expand description
EGL API instance.
An instance wraps an interface to the EGL API and provide rust-friendly access to it.
Implementations§
Source§impl<T: EGL1_0> Instance<T>
impl<T: EGL1_0> Instance<T>
Sourcepub fn matching_config_count(
&self,
display: Display,
attrib_list: &[Int],
) -> Result<usize, Error>
pub fn matching_config_count( &self, display: Display, attrib_list: &[Int], ) -> Result<usize, Error>
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
).
Sourcepub fn choose_config(
&self,
display: Display,
attrib_list: &[Int],
configs: &mut Vec<Config>,
) -> Result<(), Error>
pub fn choose_config( &self, display: Display, attrib_list: &[Int], configs: &mut Vec<Config>, ) -> Result<(), Error>
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
).
Sourcepub fn choose_first_config(
&self,
display: Display,
attrib_list: &[Int],
) -> Result<Option<Config>, Error>
pub fn choose_first_config( &self, display: Display, attrib_list: &[Int], ) -> Result<Option<Config>, Error>
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();
Sourcepub unsafe fn copy_buffers(
&self,
display: Display,
surface: Surface,
target: NativePixmapType,
) -> Result<(), Error>
pub unsafe fn copy_buffers( &self, display: Display, surface: Surface, target: NativePixmapType, ) -> Result<(), Error>
Copy EGL surface color buffer to a native pixmap.
§Safety
target
must be a valid pointer to a native pixmap that belongs
to the same platform as display
and surface
.
Sourcepub fn create_context(
&self,
display: Display,
config: Config,
share_context: Option<Context>,
attrib_list: &[Int],
) -> Result<Context, Error>
pub fn create_context( &self, display: Display, config: Config, share_context: Option<Context>, attrib_list: &[Int], ) -> Result<Context, Error>
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
).
Sourcepub fn create_pbuffer_surface(
&self,
display: Display,
config: Config,
attrib_list: &[Int],
) -> Result<Surface, Error>
pub fn create_pbuffer_surface( &self, display: Display, config: Config, attrib_list: &[Int], ) -> Result<Surface, Error>
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
).
Sourcepub unsafe fn create_pixmap_surface(
&self,
display: Display,
config: Config,
pixmap: NativePixmapType,
attrib_list: &[Int],
) -> Result<Surface, Error>
pub unsafe fn create_pixmap_surface( &self, display: Display, config: Config, pixmap: NativePixmapType, attrib_list: &[Int], ) -> Result<Surface, Error>
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
).
§Safety
This function may raise undefined behavior if the display and native pixmap do not belong to the same platform.
Sourcepub unsafe fn create_window_surface(
&self,
display: Display,
config: Config,
window: NativeWindowType,
attrib_list: Option<&[Int]>,
) -> Result<Surface, Error>
pub unsafe fn create_window_surface( &self, display: Display, config: Config, window: NativeWindowType, attrib_list: Option<&[Int]>, ) -> Result<Surface, Error>
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
).
§Safety
This function may raise undefined behavior if the display and native window do not belong to the same platform.
Sourcepub fn destroy_context(
&self,
display: Display,
ctx: Context,
) -> Result<(), Error>
pub fn destroy_context( &self, display: Display, ctx: Context, ) -> Result<(), Error>
Destroy an EGL rendering context.
Sourcepub fn destroy_surface(
&self,
display: Display,
surface: Surface,
) -> Result<(), Error>
pub fn destroy_surface( &self, display: Display, surface: Surface, ) -> Result<(), Error>
Destroy an EGL surface.
Sourcepub fn get_config_attrib(
&self,
display: Display,
config: Config,
attribute: Int,
) -> Result<Int, Error>
pub fn get_config_attrib( &self, display: Display, config: Config, attribute: Int, ) -> Result<Int, Error>
Return information about an EGL frame buffer configuration.
Sourcepub fn get_config_count(&self, display: Display) -> Result<usize, Error>
pub fn get_config_count(&self, display: Display) -> Result<usize, Error>
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);
Sourcepub fn get_configs(
&self,
display: Display,
configs: &mut Vec<Config>,
) -> Result<(), Error>
pub fn get_configs( &self, display: Display, configs: &mut Vec<Config>, ) -> Result<(), Error>
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);
Sourcepub fn get_current_display(&self) -> Option<Display>
pub fn get_current_display(&self) -> Option<Display>
Return the display for the current EGL rendering context.
Sourcepub fn get_current_surface(&self, readdraw: Int) -> Option<Surface>
pub fn get_current_surface(&self, readdraw: Int) -> Option<Surface>
Return the read or draw surface for the current EGL rendering context.
Sourcepub unsafe fn get_display(
&self,
display_id: NativeDisplayType,
) -> Option<Display>
pub unsafe fn get_display( &self, display_id: NativeDisplayType, ) -> Option<Display>
Return an EGL display connection.
§Safety
The native_display
must be a valid pointer to the native display.
Valid values for platform are defined by EGL extensions, as are
requirements for native_display. For example, an extension
specification that defines support for the X11 platform may require
that native_display be a pointer to an X11 Display, and an extension
specification that defines support for the Microsoft Windows
platform may require that native_display be a pointer to a Windows
Device Context.
Sourcepub fn get_error(&self) -> Option<Error>
pub fn get_error(&self) -> Option<Error>
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.
Sourcepub fn get_proc_address(&self, procname: &str) -> Option<extern "system" fn()>
pub fn get_proc_address(&self, procname: &str) -> Option<extern "system" fn()>
Return a GL or an EGL extension function.
Sourcepub fn initialize(&self, display: Display) -> Result<(Int, Int), Error>
pub fn initialize(&self, display: Display) -> Result<(Int, Int), Error>
Initialize an EGL display connection.
Sourcepub fn make_current(
&self,
display: Display,
draw: Option<Surface>,
read: Option<Surface>,
ctx: Option<Context>,
) -> Result<(), Error>
pub fn make_current( &self, display: Display, draw: Option<Surface>, read: Option<Surface>, ctx: Option<Context>, ) -> Result<(), Error>
Attach an EGL rendering context to EGL surfaces.
Sourcepub fn query_context(
&self,
display: Display,
ctx: Context,
attribute: Int,
) -> Result<Int, Error>
pub fn query_context( &self, display: Display, ctx: Context, attribute: Int, ) -> Result<Int, Error>
Return EGL rendering context information.
Sourcepub fn query_string(
&self,
display: Option<Display>,
name: Int,
) -> Result<&'static CStr, Error>
pub fn query_string( &self, display: Option<Display>, name: Int, ) -> Result<&'static CStr, Error>
Return a string describing properties of the EGL client or of an EGL display connection.
Sourcepub fn query_surface(
&self,
display: Display,
surface: Surface,
attribute: Int,
) -> Result<Int, Error>
pub fn query_surface( &self, display: Display, surface: Surface, attribute: Int, ) -> Result<Int, Error>
Return EGL surface information.
Sourcepub fn swap_buffers(
&self,
display: Display,
surface: Surface,
) -> Result<(), Error>
pub fn swap_buffers( &self, display: Display, surface: Surface, ) -> Result<(), Error>
Post EGL surface color buffer to a native window.
Sourcepub fn terminate(&self, display: Display) -> Result<(), Error>
pub fn terminate(&self, display: Display) -> Result<(), Error>
Terminate an EGL display connection.
Source§impl<T: EGL1_1> Instance<T>
impl<T: EGL1_1> Instance<T>
Sourcepub fn bind_tex_image(
&self,
display: Display,
surface: Surface,
buffer: Int,
) -> Result<(), Error>
pub fn bind_tex_image( &self, display: Display, surface: Surface, buffer: Int, ) -> Result<(), Error>
Defines a two-dimensional texture image.
Sourcepub fn release_tex_image(
&self,
display: Display,
surface: Surface,
buffer: Int,
) -> Result<(), Error>
pub fn release_tex_image( &self, display: Display, surface: Surface, buffer: Int, ) -> Result<(), Error>
Releases a color buffer that is being used as a texture.
Source§impl<T: EGL1_2> Instance<T>
impl<T: EGL1_2> Instance<T>
Sourcepub fn create_pbuffer_from_client_buffer(
&self,
display: Display,
buffer_type: Enum,
buffer: ClientBuffer,
config: Config,
attrib_list: &[Int],
) -> Result<Surface, Error>
pub fn create_pbuffer_from_client_buffer( &self, display: Display, buffer_type: Enum, buffer: ClientBuffer, config: Config, attrib_list: &[Int], ) -> Result<Surface, Error>
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
).
Sourcepub fn release_thread(&self) -> Result<(), Error>
pub fn release_thread(&self) -> Result<(), Error>
Release EGL per-thread state.
Sourcepub fn wait_client(&self) -> Result<(), Error>
pub fn wait_client(&self) -> Result<(), Error>
Complete client API execution prior to subsequent native rendering calls.
Source§impl<T: EGL1_4> Instance<T>
impl<T: EGL1_4> Instance<T>
Sourcepub fn get_current_context(&self) -> Option<Context>
pub fn get_current_context(&self) -> Option<Context>
Return the current EGL rendering context.
Source§impl<T: EGL1_5> Instance<T>
impl<T: EGL1_5> Instance<T>
Sourcepub unsafe fn create_sync(
&self,
display: Display,
ty: Enum,
attrib_list: &[Attrib],
) -> Result<Sync, Error>
pub unsafe fn create_sync( &self, display: Display, ty: Enum, attrib_list: &[Attrib], ) -> Result<Sync, Error>
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
).
§Safety
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.
Sourcepub unsafe fn destroy_sync(
&self,
display: Display,
sync: Sync,
) -> Result<(), Error>
pub unsafe fn destroy_sync( &self, display: Display, sync: Sync, ) -> Result<(), Error>
Destroy a sync object.
§Safety
If display does not match the display passed to eglCreateSync when sync was created, the behaviour is undefined.
Sourcepub unsafe fn client_wait_sync(
&self,
display: Display,
sync: Sync,
flags: Int,
timeout: Time,
) -> Result<Int, Error>
pub unsafe fn client_wait_sync( &self, display: Display, sync: Sync, flags: Int, timeout: Time, ) -> Result<Int, Error>
Wait in the client for a sync object to be signalled.
§Safety
If display
does not match the Display
passed to create_sync
when sync
was created, the behaviour is undefined.
Sourcepub unsafe fn get_sync_attrib(
&self,
display: Display,
sync: Sync,
attribute: Int,
) -> Result<Attrib, Error>
pub unsafe fn get_sync_attrib( &self, display: Display, sync: Sync, attribute: Int, ) -> Result<Attrib, Error>
Return an attribute of a sync object.
§Safety
If display
does not match the Display
passed to create_sync
when sync
was created, behavior is undefined.
Sourcepub fn create_image(
&self,
display: Display,
ctx: Context,
target: Enum,
buffer: ClientBuffer,
attrib_list: &[Attrib],
) -> Result<Image, Error>
pub fn create_image( &self, display: Display, ctx: Context, target: Enum, buffer: ClientBuffer, attrib_list: &[Attrib], ) -> Result<Image, Error>
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
).
Sourcepub fn destroy_image(&self, display: Display, image: Image) -> Result<(), Error>
pub fn destroy_image(&self, display: Display, image: Image) -> Result<(), Error>
Destroy an Image object.
Sourcepub unsafe fn get_platform_display(
&self,
platform: Enum,
native_display: NativeDisplayType,
attrib_list: &[Attrib],
) -> Result<Display, Error>
pub unsafe fn get_platform_display( &self, platform: Enum, native_display: NativeDisplayType, attrib_list: &[Attrib], ) -> Result<Display, Error>
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
).
§Safety
The native_display
must be a valid pointer to the native display.
Valid values for platform are defined by EGL extensions, as are
requirements for native_display. For example, an extension
specification that defines support for the X11 platform may require
that native_display be a pointer to an X11 Display, and an extension
specification that defines support for the Microsoft Windows
platform may require that native_display be a pointer to a Windows
Device Context.
Sourcepub unsafe fn create_platform_window_surface(
&self,
display: Display,
config: Config,
native_window: NativeWindowType,
attrib_list: &[Attrib],
) -> Result<Surface, Error>
pub unsafe fn create_platform_window_surface( &self, display: Display, config: Config, native_window: NativeWindowType, attrib_list: &[Attrib], ) -> Result<Surface, Error>
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
).
§Safety
The native_window
must be a valid pointer to the native window
and must belong to the same platform as display
.
EGL considers the returned EGLSurface as belonging to that same platform.
The EGL extension that defines the platform to which display belongs
also defines the requirements for the native_window
parameter.
Sourcepub unsafe fn create_platform_pixmap_surface(
&self,
display: Display,
config: Config,
native_pixmap: NativePixmapType,
attrib_list: &[Attrib],
) -> Result<Surface, Error>
pub unsafe fn create_platform_pixmap_surface( &self, display: Display, config: Config, native_pixmap: NativePixmapType, attrib_list: &[Attrib], ) -> Result<Surface, Error>
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
).
§Safety
The native_pixmap
must be a valid pointer to a native pixmap.
and must belong to the same platform as display
.
EGL considers the returned EGLSurface as belonging to that same platform.
The EGL extension that defines the platform to which display belongs
also defines the requirements for the native_pixmap
parameter.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_0>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_0>>
Sourcepub unsafe fn load_from(lib: L) -> Result<Instance<Dynamic<L, EGL1_0>>, Error>
pub unsafe fn load_from(lib: L) -> Result<Instance<Dynamic<L, EGL1_0>>, Error>
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.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_0>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_0>>
Sourcepub unsafe fn load_required_from(
lib: L,
) -> Result<Instance<Dynamic<L, EGL1_0>>, LoadError<Error>>
pub unsafe fn load_required_from( lib: L, ) -> Result<Instance<Dynamic<L, EGL1_0>>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_0>>
impl Instance<Dynamic<Library, EGL1_0>>
Sourcepub unsafe fn load_required_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_0>, LoadError<Error>>
pub unsafe fn load_required_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_0>, LoadError<Error>>
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.
Sourcepub unsafe fn load_required() -> Result<DynamicInstance<EGL1_0>, LoadError<Error>>
pub unsafe fn load_required() -> Result<DynamicInstance<EGL1_0>, LoadError<Error>>
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.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_1>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_1>>
Sourcepub unsafe fn load_required_from(
lib: L,
) -> Result<Instance<Dynamic<L, EGL1_1>>, LoadError<Error>>
pub unsafe fn load_required_from( lib: L, ) -> Result<Instance<Dynamic<L, EGL1_1>>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_1>>
impl Instance<Dynamic<Library, EGL1_1>>
Sourcepub unsafe fn load_required_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_1>, LoadError<Error>>
pub unsafe fn load_required_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_1>, LoadError<Error>>
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.
Sourcepub unsafe fn load_required() -> Result<DynamicInstance<EGL1_1>, LoadError<Error>>
pub unsafe fn load_required() -> Result<DynamicInstance<EGL1_1>, LoadError<Error>>
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.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_2>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_2>>
Sourcepub unsafe fn load_required_from(
lib: L,
) -> Result<Instance<Dynamic<L, EGL1_2>>, LoadError<Error>>
pub unsafe fn load_required_from( lib: L, ) -> Result<Instance<Dynamic<L, EGL1_2>>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_2>>
impl Instance<Dynamic<Library, EGL1_2>>
Sourcepub unsafe fn load_required_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_2>, LoadError<Error>>
pub unsafe fn load_required_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_2>, LoadError<Error>>
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.
Sourcepub unsafe fn load_required() -> Result<DynamicInstance<EGL1_2>, LoadError<Error>>
pub unsafe fn load_required() -> Result<DynamicInstance<EGL1_2>, LoadError<Error>>
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.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_3>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_3>>
Sourcepub unsafe fn load_required_from(
lib: L,
) -> Result<Instance<Dynamic<L, EGL1_3>>, LoadError<Error>>
pub unsafe fn load_required_from( lib: L, ) -> Result<Instance<Dynamic<L, EGL1_3>>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_3>>
impl Instance<Dynamic<Library, EGL1_3>>
Sourcepub unsafe fn load_required_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_3>, LoadError<Error>>
pub unsafe fn load_required_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_3>, LoadError<Error>>
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.
Sourcepub unsafe fn load_required() -> Result<DynamicInstance<EGL1_3>, LoadError<Error>>
pub unsafe fn load_required() -> Result<DynamicInstance<EGL1_3>, LoadError<Error>>
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.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_4>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_4>>
Sourcepub unsafe fn load_required_from(
lib: L,
) -> Result<Instance<Dynamic<L, EGL1_4>>, LoadError<Error>>
pub unsafe fn load_required_from( lib: L, ) -> Result<Instance<Dynamic<L, EGL1_4>>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_4>>
impl Instance<Dynamic<Library, EGL1_4>>
Sourcepub unsafe fn load_required_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_4>, LoadError<Error>>
pub unsafe fn load_required_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_4>, LoadError<Error>>
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.
Sourcepub unsafe fn load_required() -> Result<DynamicInstance<EGL1_4>, LoadError<Error>>
pub unsafe fn load_required() -> Result<DynamicInstance<EGL1_4>, LoadError<Error>>
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.
Source§impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_5>>
impl<L: Borrow<Library>> Instance<Dynamic<L, EGL1_5>>
Sourcepub unsafe fn load_required_from(
lib: L,
) -> Result<Instance<Dynamic<L, EGL1_5>>, LoadError<Error>>
pub unsafe fn load_required_from( lib: L, ) -> Result<Instance<Dynamic<L, EGL1_5>>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_5>>
impl Instance<Dynamic<Library, EGL1_5>>
Sourcepub unsafe fn load_required_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_5>, LoadError<Error>>
pub unsafe fn load_required_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_5>, LoadError<Error>>
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.
Sourcepub unsafe fn load_required() -> Result<DynamicInstance<EGL1_5>, LoadError<Error>>
pub unsafe fn load_required() -> Result<DynamicInstance<EGL1_5>, LoadError<Error>>
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.
Source§impl Instance<Dynamic<Library, EGL1_0>>
impl Instance<Dynamic<Library, EGL1_0>>
Sourcepub unsafe fn load_from_filename<P: AsRef<OsStr>>(
filename: P,
) -> Result<DynamicInstance<EGL1_0>, Error>
pub unsafe fn load_from_filename<P: AsRef<OsStr>>( filename: P, ) -> Result<DynamicInstance<EGL1_0>, Error>
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.
Sourcepub unsafe fn load() -> Result<DynamicInstance<EGL1_0>, Error>
pub unsafe fn load() -> Result<DynamicInstance<EGL1_0>, Error>
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.