Module glium::framebuffer
[−]
[src]
Framebuffers allow you to customize the color, depth and stencil buffers you will draw on.
In order to draw on a texture, use a SimpleFrameBuffer. This framebuffer is compatible with
shaders that write to gl_FragColor.
let framebuffer = glium::framebuffer::SimpleFrameBuffer::new(&display, &texture); // framebuffer.draw(...); // draws over `texture`
If, however, your shader wants to write to multiple color buffers at once, you must use
a MultiOutputFrameBuffer.
let output = &[ ("output1", &texture1), ("output2", &texture2) ]; let framebuffer = glium::framebuffer::MultiOutputFrameBuffer::new(&display, output); // framebuffer.draw(...); // example shader: // // out vec4 output1; // out vec4 output2; // // void main() { // output1 = vec4(0.0, 0.0, 0.5, 1.0); // output2 = vec4(1.0, 0.7, 1.0, 1.0); // }
Note: depth-stencil attachments are not yet implemented.
Structs
| DepthRenderBuffer |
A render buffer is similar to a texture, but is optimized for usage as a draw target. |
| DepthStencilRenderBuffer |
A render buffer is similar to a texture, but is optimized for usage as a draw target. |
| MultiOutputFrameBuffer |
This struct is useless for the moment. |
| RenderBuffer |
A render buffer is similar to a texture, but is optimized for usage as a draw target. |
| RenderBufferAny |
A RenderBuffer of indeterminate type. |
| SimpleFrameBuffer |
A framebuffer which has only one color attachment. |
| StencilRenderBuffer |
A render buffer is similar to a texture, but is optimized for usage as a draw target. |
Enums
| ColorAttachment |
Describes an attachment for a color buffer. |
| DepthAttachment |
Describes an attachment for a depth buffer. |
| DepthStencilAttachment |
Describes an attachment for a depth and stencil buffer. |
| StencilAttachment |
Describes an attachment for a stencil buffer. |
Traits
| ToColorAttachment |
Trait for objects that can be used as color attachments. |
| ToDepthAttachment |
Trait for objects that can be used as depth attachments. |
| ToDepthStencilAttachment |
Trait for objects that can be used as depth and stencil attachments. |
| ToStencilAttachment |
Trait for objects that can be used as stencil attachments. |