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
unsafe fn gen_framebuffer(&self) -> Framebuffer
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
fn check_framebuffer_status(
&self,
gl_fbo: &FramebufferBinding
) -> Option<GLFramebufferError>
&self,
gl_fbo: &FramebufferBinding
) -> Option<GLFramebufferError>
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
fn framebuffer_renderbuffer(
&self,
gl_fbo: &mut FramebufferBinding,
attachment: FramebufferAttachment,
renderbuffer: &mut Renderbuffer
)
&self,
gl_fbo: &mut FramebufferBinding,
attachment: FramebufferAttachment,
renderbuffer: &mut Renderbuffer
)
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
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,
&self,
gl_fbo: &mut FramebufferBinding,
attachment: FramebufferAttachment,
tex_target: I,
texture: &mut Texture<T>,
level: i32
) where
I: Into<T::ImageTargetType>,
T: TextureType,
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
fn clear(&self, buffers: BufferBits)
Implementors
impl<C: BaseContext> ContextFramebufferExt for C