Trait gstreamer_gl::prelude::GLContextExt [−][src]
pub trait GLContextExt: 'static {}Show methods
fn activate(&self, activate: bool) -> Result<(), BoolError>; fn can_share<P: IsA<GLContext>>(&self, other_context: &P) -> 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<P: IsA<GLContext>>(
&self,
other_context: Option<&P>
) -> 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<P: IsA<GLContext>>(&self, share: &P); fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> 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);
Expand description
Required methods
(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
Note: This will always fail for two wrapped GLContext
’s
other_context
another GLContext
Returns
whether self
and other_context
are able to share OpenGL
resources.
fn check_feature(&self, feature: &str) -> bool
[src]
fn check_feature(&self, feature: &str) -> bool
[src]fn check_framebuffer_status(&self, fbo_target: u32) -> bool
[src]
fn check_framebuffer_status(&self, fbo_target: u32) -> bool
[src]Must be called with self
current.
fbo_target
the GL value of the framebuffer target, GL_FRAMEBUFFER, GL_READ_FRAMEBUFFER, GL_DRAW_FRAMEBUFFER
Returns
whether whether the current framebuffer is complete
fn clear_framebuffer(&self)
[src]
fn clear_framebuffer(&self)
[src]Unbind the current framebuffer
fn clear_shader(&self)
[src]
fn clear_shader(&self)
[src]Clear’s the currently set shader from the GL state machine.
Note: must be called in the GL thread.
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
Destroys an OpenGL context.
Should only be called after create()
has been successfully
called for this context.
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.
v1_20
only.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.
fn gl_platform(&self) -> GLPlatform
[src]
fn gl_platform(&self) -> GLPlatform
[src]fn request_config(&self, gl_config: Option<&Structure>) -> bool
[src]
fn request_config(&self, gl_config: Option<&Structure>) -> bool
[src]v1_20
only.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
fn supports_glsl_profile_version(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]
fn supports_glsl_profile_version(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool
[src]
fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool
[src]v1_16
only.fn supports_precision_highp(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]
fn supports_precision_highp(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]v1_16
only.fn swap_buffers(&self)
[src]
fn swap_buffers(&self)
[src]Swap the front and back buffers on the window attached to self
.
This will display the frame on the next refresh cycle.
Implementors
v1_20
only.v1_16
only.v1_16
only.