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 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 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);
Required methods
fn activate(&self, activate: bool) -> Result<(), BoolError>
[src]
(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 Self::set_window()
for details.
activate
true
to activate, false
to deactivate
Returns
Whether the activation succeeded
fn can_share<P: IsA<GLContext>>(&self, other_context: &P) -> bool
[src]
Note: This will always fail for two wrapped crate::GLContext
’s
other_context
another crate::GLContext
Returns
whether self
and other_context
are able to share OpenGL
resources.
fn check_feature(&self, feature: &str) -> bool
[src]
Check for an OpenGL feature
being supported.
Note: Most features require that the context be created before it is possible to determine their existence and so will fail if that is not the case.
feature
a platform specific feature
Returns
Whether feature
is supported by self
fn check_framebuffer_status(&self, fbo_target: u32) -> bool
[src]
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 check_gl_version(&self, api: GLAPI, maj: i32, min: i32) -> bool
[src]
api
api type required
maj
major version required
min
minor version required
Returns
whether OpenGL context implements the required api and specified version.
fn clear_framebuffer(&self)
[src]
Unbind the current framebuffer
fn clear_shader(&self)
[src]
Clear’s the currently set shader from the GL state machine.
Note: must be called in the GL thread.
fn create<P: IsA<GLContext>>(
&self,
other_context: Option<&P>
) -> Result<(), Error>
[src]
&self,
other_context: Option<&P>
) -> 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.
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 crate::GLContext
to share OpenGL objects with
Returns
whether the context could successfully be created
fn destroy(&self)
[src]
Destroys an OpenGL context.
Should only be called after Self::create()
has been successfully
called for this context.
fn fill_info(&self) -> Result<(), Error>
[src]
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 crate::GLContext
’s.
fn display(&self) -> GLDisplay
[src]
Returns
the crate::GLDisplay
associated with this self
fn gl_api(&self) -> GLAPI
[src]
Get the currently enabled OpenGL api.
The currently available API may be limited by the crate::GLDisplay
in use and/or
the crate::GLWindow
chosen.
Returns
the available OpenGL api
fn gl_platform(&self) -> GLPlatform
[src]
fn gl_platform_version(&self) -> (i32, i32)
[src]
Get the version of the OpenGL platform (GLX, EGL, etc) used. Only valid
after a call to Self::create()
.
major
return for the major version
minor
return for the minor version
fn gl_version(&self) -> (i32, i32)
[src]
Returns the OpenGL version implemented by self
. See
[Self::get_gl_api()
] for retrieving the OpenGL api implemented by
self
.
maj
resulting major version
min
resulting minor version
fn window(&self) -> Option<GLWindow>
[src]
Returns
the currently set window
fn is_shared(&self) -> bool
[src]
Returns
Whether the crate::GLContext
has been shared with another crate::GLContext
fn set_shared_with<P: IsA<GLContext>>(&self, share: &P)
[src]
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), BoolError>
[src]
Set’s the current window on self
to window
. The window can only be
changed before Self::create()
has been called and the window
is not
already running.
window
Returns
Whether the window was successfully updated
fn supports_glsl_profile_version(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool
[src]
v1_16
only.fn supports_precision_highp(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
v1_16
only.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
impl<O: IsA<GLContext>> GLContextExt for O
[src]
impl<O: IsA<GLContext>> GLContextExt for O
[src]fn activate(&self, activate: bool) -> Result<(), BoolError>
[src]
fn can_share<P: IsA<GLContext>>(&self, other_context: &P) -> bool
[src]
fn check_feature(&self, feature: &str) -> bool
[src]
fn check_framebuffer_status(&self, fbo_target: u32) -> bool
[src]
fn check_gl_version(&self, api: GLAPI, maj: i32, min: i32) -> bool
[src]
fn clear_framebuffer(&self)
[src]
fn clear_shader(&self)
[src]
fn create<P: IsA<GLContext>>(
&self,
other_context: Option<&P>
) -> Result<(), Error>
[src]
&self,
other_context: Option<&P>
) -> Result<(), Error>
fn destroy(&self)
[src]
fn fill_info(&self) -> Result<(), Error>
[src]
fn display(&self) -> GLDisplay
[src]
fn gl_api(&self) -> GLAPI
[src]
fn gl_platform(&self) -> GLPlatform
[src]
fn gl_platform_version(&self) -> (i32, i32)
[src]
fn gl_version(&self) -> (i32, i32)
[src]
fn window(&self) -> Option<GLWindow>
[src]
fn is_shared(&self) -> bool
[src]
fn set_shared_with<P: IsA<GLContext>>(&self, share: &P)
[src]
fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), BoolError>
[src]
fn supports_glsl_profile_version(
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
[src]
&self,
version: GLSLVersion,
profile: GLSLProfile
) -> bool
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.