Skip to content

Commit

Permalink
Integrated an example render to frame buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
GeReV committed Feb 3, 2020
1 parent fd595db commit 4710980
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,24 @@ fn run() -> Result<(), failure::Error> {

let texture_rc = Rc::<render_gl::Texture>::new(texture);

let texture_buffer = render_gl::Texture::new(
&gl,
initial_window_size.0 as u32,
initial_window_size.1 as u32,
)?;

let frame_buffer = render_gl::FrameBuffer::new(&gl);

frame_buffer.bind();
frame_buffer.attach_texture(&texture_buffer);

let color_buffer2 = render_gl::ColorBuffer::from_color(na::Vector3::new(0.5, 0.6, 0.8));

color_buffer2.set_used(&gl);
color_buffer2.clear(&gl);

frame_buffer.unbind();

let background = background::Background::new(
&res,
&gl,
Expand Down

0 comments on commit 4710980

Please sign in to comment.