Commit f25eb9e1 authored by Mathieu Nivoliez's avatar Mathieu Nivoliez
Browse files

Try to correct stuff.

parent 26c267dc
Pipeline #289 failed with stages
in 8 minutes and 17 seconds
......@@ -3,6 +3,6 @@ authors = ["Mathieu Nivoliez <mathieu.nivoliez@laposte.net>"]
name = "DeepVox"
version = "0.1.0"
[dependencies]
gfx = "0.16"
gfx_window_glutin = "0.16"
glutin = "0.8"
gfx = "0.17"
gfx_window_glutin = "0.20"
glutin = "0.12"
#[macro_use] extern crate gfx;
#[macro_use]
extern crate gfx;
extern crate gfx_window_glutin;
extern crate glutin;
......@@ -6,6 +7,7 @@ extern crate glutin;
use gfx::traits::FactoryExt;
use gfx::Device;
use gfx_window_glutin as gfx_glutin;
use glutin::GlContext;
pub type ColorFormat = gfx::format::Srgba8;
pub type DepthFormat = gfx::format::DepthStencil;
......@@ -16,25 +18,28 @@ pub fn main() {
let events_loop = glutin::EventsLoop::new();
let builder = glutin::WindowBuilder::new()
.with_title("Square Toy".to_string())
.with_dimensions(800, 800)
.with_vsync();
.with_dimensions(800, 800);
let context = glutin::ContextBuilder::new()
.with_gl(glutin::GlRequest::Latest)
.with_vsync(true);
let (window, mut device, mut factory, mut main_color, mut main_depth) =
gfx_glutin::init::<ColorFormat, DepthFormat>(builder, &events_loop);
gfx_glutin::init::<ColorFormat, DepthFormat>(builder, context, &events_loop);
let mut encoder: gfx::Encoder<_, _> = factory.create_command_buffer().into();
let mut running = true;
while running {
events_loop.poll_events(|glutin::Event::WindowEvent{window_id: _, event}| {
use glutin::WindowEvent::*;
match event {
KeyboardInput(_, _, Some(glutin::VirtualKeyCode::Escape), _)
| Closed => running = false,
Resized(_, _) => {
events_loop.poll_events(|event| match event {
glutin::Event::WindowEvent { event, .. } => match event {
glutin::WindowEvent::Closed => running = false,
glutin::WindowEvent::Resized(_, _) => {
gfx_glutin::update_views(&window, &mut main_color, &mut main_depth);
},
}
_ => (),
}
},
_ => (),
});
encoder.clear(&main_color, BLACK);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment