Trait glitter::context::framebuffer_context::ContextFramebufferExt [] [src]

pub trait ContextFramebufferExt: BaseContext {
    unsafe fn gen_framebuffer(&self) -> Framebuffer { ... }
    fn check_framebuffer_status(
        &self,
        gl_fbo: &FramebufferBinding
    ) -> Option<GLFramebufferError> { ... } fn framebuffer_renderbuffer(
        &self,
        gl_fbo: &mut FramebufferBinding,
        attachment: FramebufferAttachment,
        renderbuffer: &mut Renderbuffer
    ) { ... } fn framebuffer_texture_2d<I, T>(
        &self,
        gl_fbo: &mut FramebufferBinding,
        attachment: FramebufferAttachment,
        tex_target: I,
        texture: &mut Texture<T>,
        level: i32
    )
    where
        I: Into<T::ImageTargetType>,
        T: TextureType
, { ... } fn clear(&self, buffers: BufferBits) { ... } }

An extension trait that includes framebuffer-related OpenGL methods.

Provided Methods

Create a new framebuffer object with no attachments.

Safety

Most OpenGL function calls assume a framebuffer object will be framebuffer-complete. Since the new framebuffer will have no attachments, it will not be framebuffer-complete. Violating this invariant is considered undefined behavior in glitter.

See also

gl.build_framebuffer: A safe wrapper for building a framebuffer, which ensures framebuffer-completeness.

gl.check_framebuffer_status: Checks to see if a framebuffer object is framebuffer-complete.

glGenFramebuffers OpenGL docs

Returns the status of any framebuffer-completeness errors of a currently-bound framebuffer object. Returns None if the framebuffer is framebuffer-complete.

See also

glCheckFramebufferStatus OpenGL docs

Attach a renderbuffer object to a framebuffer object's attachment point.

  • gl_fbo: The binding of the framebuffer to attach to.
  • attachment: Which attachment point of the framebuffer to attach to.
  • renderbuffer: The renderbuffer to attach.

See also

glFramebufferRenderbuffer OpenGL docs

Attach a texture to a framebuffer object's attachment point.

  • gl_fbo: The binding of the framebuffer to attach to.
  • attachment: Which attachment point of the framebuffer to attach to.
  • tex_target: The 2D 'face' of the texture to attach.
  • texture: The texture to attach.
  • level: The mipmap level of the texture to attach. Note that this value must be 0.

Panics

This function will panic with a debug assertion if level is not 0.

See also

glFramebufferTexture2D OpenGL docs

Clear the currently-bound drawing buffers that are specified by the buffers argument.

See also

glClear OpenGL docs

Implementors