Trait gstreamer_gl::prelude::GLContextExt
source · pub trait GLContextExt:
IsA<GLContext>
+ Sealed
+ 'static {
Show 25 methods
// Provided methods
fn activate(&self, activate: bool) -> Result<(), BoolError> { ... }
fn can_share(&self, other_context: &impl IsA<GLContext>) -> bool { ... }
fn check_feature(&self, feature: &str) -> bool { ... }
fn check_framebuffer_status(&self, fbo_target: u32) -> bool { ... }
fn check_gl_version(&self, api: GLAPI, maj: i32, min: i32) -> bool { ... }
fn clear_framebuffer(&self) { ... }
fn clear_shader(&self) { ... }
fn create(
&self,
other_context: Option<&impl IsA<GLContext>>,
) -> Result<(), Error> { ... }
fn destroy(&self) { ... }
fn fill_info(&self) -> Result<(), Error> { ... }
fn config(&self) -> Option<Structure> { ... }
fn display(&self) -> GLDisplay { ... }
fn gl_api(&self) -> GLAPI { ... }
fn gl_platform(&self) -> GLPlatform { ... }
fn gl_platform_version(&self) -> (i32, i32) { ... }
fn gl_version(&self) -> (i32, i32) { ... }
fn window(&self) -> Option<GLWindow> { ... }
fn is_shared(&self) -> bool { ... }
fn request_config(&self, gl_config: Option<Structure>) -> bool { ... }
fn set_shared_with(&self, share: &impl IsA<GLContext>) { ... }
fn set_window(&self, window: impl IsA<GLWindow>) -> Result<(), BoolError> { ... }
fn supports_glsl_profile_version(
&self,
version: GLSLVersion,
profile: GLSLProfile,
) -> bool { ... }
fn supports_precision(
&self,
version: GLSLVersion,
profile: GLSLProfile,
) -> bool { ... }
fn supports_precision_highp(
&self,
version: GLSLVersion,
profile: GLSLProfile,
) -> bool { ... }
fn swap_buffers(&self) { ... }
}
Provided Methods§
sourcefn activate(&self, activate: bool) -> Result<(), BoolError>
fn activate(&self, activate: bool) -> Result<(), BoolError>
(De)activate the OpenGL context represented by this self
.
In OpenGL terms, calls eglMakeCurrent or similar with this context and the
currently set window. See set_window()
for details.
§activate
true
to activate, false
to deactivate
§Returns
Whether the activation succeeded
sourcefn check_feature(&self, feature: &str) -> bool
fn check_feature(&self, feature: &str) -> bool
sourcefn check_framebuffer_status(&self, fbo_target: u32) -> bool
fn check_framebuffer_status(&self, fbo_target: u32) -> bool
sourcefn clear_framebuffer(&self)
fn clear_framebuffer(&self)
Unbind the current framebuffer
sourcefn clear_shader(&self)
fn clear_shader(&self)
Clear’s the currently set shader from the GL state machine.
Note: must be called in the GL thread.
sourcefn create(
&self,
other_context: Option<&impl IsA<GLContext>>,
) -> Result<(), Error>
fn create( &self, other_context: Option<&impl IsA<GLContext>>, ) -> Result<(), Error>
Creates an OpenGL context with the specified other_context
as a context
to share shareable OpenGL objects with. See the OpenGL specification for
what is shared between OpenGL contexts.
Since 1.20, the configuration can be overriden with the environment variable
GST_GL_CONFIG
which is a stringified gst::Structure
as would be returned
from config()
. If GST_GL_CONFIG
is not set, then the
config will be chosen from other_context
by calling
config()
on other_context
. Otherwise, a default
configuration is used.
Calling request_config()
) before calling
create()
will override the config from other_context
but
will not override the GST_GL_CONFIG
environment variable.
If an error occurs, and error
is not None
, then error
will contain
details of the error and false
will be returned.
Should only be called once.
§other_context
a GLContext
to share OpenGL objects with
§Returns
whether the context could successfully be created
fn destroy(&self)
sourcefn fill_info(&self) -> Result<(), Error>
fn fill_info(&self) -> Result<(), Error>
Fills self
’s info (version, extensions, vtable, etc) from the GL
context in the current thread. Typically used with wrapped contexts to
allow wrapped contexts to be used as regular GLContext
’s.
sourcefn config(&self) -> Option<Structure>
fn config(&self) -> Option<Structure>
Retrieve the OpenGL configuration for this context. The context must have been successfully created for this function to return a valid value.
Not all implementations currently support retrieving the config and will
return None
when not supported.
§Returns
the configuration chosen for this OpenGL context.
sourcefn gl_platform(&self) -> GLPlatform
fn gl_platform(&self) -> GLPlatform
sourcefn gl_platform_version(&self) -> (i32, i32)
fn gl_platform_version(&self) -> (i32, i32)
sourcefn gl_version(&self) -> (i32, i32)
fn gl_version(&self) -> (i32, i32)
sourcefn request_config(&self, gl_config: Option<Structure>) -> bool
fn request_config(&self, gl_config: Option<Structure>) -> bool
Set the OpenGL configuration for this context. The context must not
have been created for this function to succeed. Setting a None
config
has the affect of removing any specific configuration request.
Not all implementations currently support retrieving the config and this function will return FALSE when not supported.
Note that calling this function may cause a subsequent
create()
to fail if config
could not be matched with
the platform-specific configuration.
Note that the actual config used may be differ from the requested values.
§gl_config
a configuration structure for configuring the OpenGL context
§Returns
whether gl_config
could be successfully set on self
sourcefn supports_glsl_profile_version(
&self,
version: GLSLVersion,
profile: GLSLProfile,
) -> bool
fn supports_glsl_profile_version( &self, version: GLSLVersion, profile: GLSLProfile, ) -> bool
sourcefn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool
fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool
sourcefn supports_precision_highp(
&self,
version: GLSLVersion,
profile: GLSLProfile,
) -> bool
fn supports_precision_highp( &self, version: GLSLVersion, profile: GLSLProfile, ) -> bool
sourcefn swap_buffers(&self)
fn swap_buffers(&self)
Swap the front and back buffers on the window attached to self
.
This will display the frame on the next refresh cycle.