Skip to content

Commit

Permalink
Remove framebuffer and we have parity between WebGL and OpenGL builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
thebracket committed Nov 21, 2019
1 parent 9306f2c commit 48a997e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 167 deletions.
147 changes: 0 additions & 147 deletions src/hal/framebuffer.rs

This file was deleted.

3 changes: 0 additions & 3 deletions src/hal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ mod wasm;
#[cfg(target_arch = "wasm32")]
pub use wasm::*;

mod framebuffer;
pub use framebuffer::Framebuffer;

mod shader;
pub use shader::Shader;

Expand Down
6 changes: 1 addition & 5 deletions src/hal/native/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,6 @@ pub fn init_raw<S: ToString>(
shader_strings::TEST_FS,
));

// Build the backing frame-buffer
let backing_fbo = Framebuffer::build_fbo(&gl, width_pixels as i32, height_pixels as i32);

// Build a simple quad rendering vao
let quad_vao = setup_quad(&gl);

Expand All @@ -76,8 +73,7 @@ pub fn init_raw<S: ToString>(
context_wrapper: Some(WrappedContext {
el,
wc: windowed_context,
}),
backing_buffer: backing_fbo,
})
},
},
width_pixels,
Expand Down
10 changes: 0 additions & 10 deletions src/hal/native/mainloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,6 @@ pub fn main_loop<GS: GameState>(mut rltk: Rltk, mut gamestate: GS) {
physical.height as i32,
);
}
rltk.backend.platform.backing_buffer = Framebuffer::build_fbo(
&rltk.backend.gl,
physical.width as i32,
physical.height as i32,
);
}
WindowEvent::RedrawRequested => {
//tock(&mut rltk, &mut gamestate, &mut frames, &mut prev_seconds, &mut prev_ms, &now);
Expand Down Expand Up @@ -149,11 +144,6 @@ fn tock<GS: GameState>(
cons.console.rebuild_if_dirty(&rltk.backend.gl);
}

// Bind to the backing buffer
if rltk.post_scanlines {
rltk.backend.platform.backing_buffer.bind(&rltk.backend.gl);
}

// Clear the screen
unsafe {
rltk.backend.gl.clear_color(0.2, 0.3, 0.3, 1.0);
Expand Down
3 changes: 1 addition & 2 deletions src/hal/native/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ pub use sparse_console_backing::*;

pub struct PlatformGL {
pub quad_vao: u32,
pub context_wrapper: Option<WrappedContext>,
pub backing_buffer: super::Framebuffer,
pub context_wrapper: Option<WrappedContext>
}

pub struct WrappedContext {
Expand Down

0 comments on commit 48a997e

Please sign in to comment.