Struct mini_gl_fb::core::Framebuffer [−][src]
pub struct Framebuffer { pub buffer_width: i32, pub buffer_height: i32, pub vp_width: i32, pub vp_height: i32, pub program: GLuint, pub sampler_location: GLint, pub vertex_shader: Option<GLuint>, pub geometry_shader: Option<GLuint>, pub fragment_shader: Option<GLuint>, pub texture: GLuint, pub vao: GLuint, pub vbo: GLuint, pub texture_format: (BufferFormat, GLenum), pub did_draw: bool, }
Provides the drawing functionality.
You can get direct access by using a breakout function, such as breakout_glutin.
Disclaimer:
Accessing fields directly is not the intended usage. If a feature is missing please open an issue. The fields are public, however, so that while you are waiting for a feature to be exposed, if you need something in a pinch you can dig in easily and make it happen.
The internal fields may change.
TODO: Possibly create a FramebufferInternal struct?
Fields
buffer_width: i32
buffer_height: i32
vp_width: i32
vp_height: i32
program: GLuint
sampler_location: GLint
vertex_shader: Option<GLuint>
geometry_shader: Option<GLuint>
fragment_shader: Option<GLuint>
texture: GLuint
vao: GLuint
vbo: GLuint
texture_format: (BufferFormat, GLenum)
did_draw: bool
Methods
impl Framebuffer
[src]
impl Framebuffer
pub fn update_buffer<T>(&mut self, image_data: &[T])
[src]
pub fn update_buffer<T>(&mut self, image_data: &[T])
pub fn use_vertex_shader(&mut self, source: &str)
[src]
pub fn use_vertex_shader(&mut self, source: &str)
pub fn use_fragment_shader(&mut self, source: &str)
[src]
pub fn use_fragment_shader(&mut self, source: &str)
pub fn use_post_process_shader(&mut self, source: &str)
[src]
pub fn use_post_process_shader(&mut self, source: &str)
pub fn use_geometry_shader(&mut self, source: &str)
[src]
pub fn use_geometry_shader(&mut self, source: &str)
pub fn use_grayscale_shader(&mut self)
[src]
pub fn use_grayscale_shader(&mut self)
pub fn change_buffer_format<T: ToGlType>(&mut self, format: BufferFormat)
[src]
pub fn change_buffer_format<T: ToGlType>(&mut self, format: BufferFormat)
pub fn resize_buffer(&mut self, buffer_width: u32, buffer_height: u32)
[src]
pub fn resize_buffer(&mut self, buffer_width: u32, buffer_height: u32)
pub fn resize_viewport(&mut self, width: u32, height: u32)
[src]
pub fn resize_viewport(&mut self, width: u32, height: u32)
pub fn redraw(&mut self)
[src]
pub fn redraw(&mut self)
pub fn draw<F: FnOnce(&Framebuffer)>(&mut self, f: F)
[src]
pub fn draw<F: FnOnce(&Framebuffer)>(&mut self, f: F)
Draw the quad to the active context. Optionally issue other commands after binding everything but before
You probably want redraw
(equivalent to .draw(|_| {})
).
pub fn relink_program(&mut self)
[src]
pub fn relink_program(&mut self)
Auto Trait Implementations
impl Send for Framebuffer
impl Send for Framebuffer
impl Sync for Framebuffer
impl Sync for Framebuffer