Do not use forward pipeline in hello world example
use dust::*;
use dust::window::event::*;
+use dust::core::rendertarget::Rendertarget;
fn main() {
@@ -7,7 +8,7 @@ fn main() {
let (width, height) = window.framebuffer_size();
let gl = window.gl();
- let renderer = ForwardPipeline::new(&gl, width, height, vec4(0.8, 0.8, 0.8, 1.0)).unwrap();
+ let rendertarget = rendertarget::ScreenRendertarget::new(&gl, width, height, vec4(0.8, 0.8, 0.8, 1.0)).unwrap();
// Camera
let mut camera = camera::PerspectiveCamera::new(vec3(0.0, 0.0, 2.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0),
@@ -38,7 +39,8 @@ fn main() {
handle_camera_events(&event, &mut camera_handler, &mut camera);
}
- renderer.render_pass_begin();
+ rendertarget.bind();
+ rendertarget.clear();
program.use_attribute_vec3_float(&buffer, "position", 0).unwrap();
program.use_attribute_vec3_float(&buffer, "color", 1).unwrap();
