[][src]Trait gstreamer_gl::GLContextExt

pub trait GLContextExt: 'static {
    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 get_display(&self) -> GLDisplay;
fn get_gl_api(&self) -> GLAPI;
fn get_gl_platform(&self) -> GLPlatform;
fn get_gl_platform_version(&self) -> (i32, i32);
fn get_gl_version(&self) -> (i32, i32);
fn get_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); }

Trait containing all GLContext methods.

Implementors

GLContext

Required methods

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 GLContextExt::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

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

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

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

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)

Unbind the current framebuffer

fn clear_shader(&self)

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>

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 GLContext to share OpenGL objects with

Returns

whether the context could successfully be created

fn destroy(&self)

Destroys an OpenGL context.

Should only be called after GLContextExt::create has been successfully called for this context.

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.

fn get_display(&self) -> GLDisplay

Returns

the GLDisplay associated with this self

fn get_gl_api(&self) -> GLAPI

Get the currently enabled OpenGL api.

The currently available API may be limited by the GLDisplay in use and/or the GLWindow chosen.

Returns

the available OpenGL api

fn get_gl_platform(&self) -> GLPlatform

Gets the OpenGL platform that used by self.

Returns

The platform specific backing OpenGL context

fn get_gl_platform_version(&self) -> (i32, i32)

Get the version of the OpenGL platform (GLX, EGL, etc) used. Only valid after a call to GLContextExt::create.

major

return for the major version

minor

return for the minor version

fn get_gl_version(&self) -> (i32, i32)

Returns the OpenGL version implemented by self. See GLContextExt::get_gl_api for retrieving the OpenGL api implemented by self.

maj

resulting major version

min

resulting minor version

fn get_window(&self) -> Option<GLWindow>

Returns

the currently set window

fn is_shared(&self) -> bool

Returns

Whether the GLContext has been shared with another GLContext

fn set_shared_with<P: IsA<GLContext>>(&self, share: &P)

Will internally set self as shared with share

share

another GLContext

fn set_window<P: IsA<GLWindow>>(&self, window: &P) -> Result<(), BoolError>

Set's the current window on self to window. The window can only be changed before GLContextExt::create has been called and the window is not already running.

window

a GLWindow

Returns

Whether the window was successfully updated

fn supports_glsl_profile_version(
    &self,
    version: GLSLVersion,
    profile: GLSLProfile
) -> bool

version

a GLSLVersion

profile

a GLSLProfile

Returns

Whether self supports the combination of version with profile

fn supports_precision(&self, version: GLSLVersion, profile: GLSLProfile) -> bool

Feature: v1_16

version

a GLSLVersion

profile

a GLSLProfile

Returns

whether self supports the 'precision' specifier in GLSL shaders

fn supports_precision_highp(
    &self,
    version: GLSLVersion,
    profile: GLSLProfile
) -> bool

Feature: v1_16

version

a GLSLVersion

profile

a GLSLProfile

Returns

whether self supports the 'precision highp' specifier in GLSL shaders

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.

Loading content...

Implementors

impl<O: IsA<GLContext>> GLContextExt for O[src]

Loading content...