Struct glitter::context::framebuffer_context::FramebufferBuilder [] [src]

pub struct FramebufferBuilder<'a, C> where
    C: FramebufferContext
{ /* fields omitted */ }

Provides a safe interface for building a framebuffer object that is checked to be framebuffer-complete. A FramebufferBuilder can be created using the gl.build_framebuffer method.

Note

The current implementation of FramebufferBuilder uses heap-allocation during construction. This should be fixed in a future release, but consider falling back to the more direct gl.gen_framebuffer if this ends up being problematic.

Methods

impl<'a, C> FramebufferBuilder<'a, C> where
    C: FramebufferContext
[src]

[src]

Add a 2D texture (at the mipmap level specified by level) to the framebuffer's attachment point.

Failures

level should be 0, or unwrapping the framebuffer will fail.

Note

Currently, only Texture2d textures are supported using a FramebufferBuilder. To bind a different type of texture, use gl.framebuffer_texture_2d on an existing framebuffer object instead (generated either with a FramebufferBuilder or with gl.gen_framebuffer).

[src]

Add a renderbuffer to the framebuffer's attachment point.

[src]

Create and return a framebuffer with the specified options, or return an error.

Failures

If the resulting framebuffer is not framebuffer-complete, an error will be returned.

Panics

This function will panic if an OpenGL error was generated with debug assertions enabled.

[src]

Create and return a framebuffer with the specified options, or panic.

Panics

This function will panic if the resulting framebuffer is not framebuffer-complete or an OpenGL error was generated with debug assertions enabled.