init commit
This commit is contained in:
commit
9a33becab8
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/target
|
1133
Cargo.lock
generated
Normal file
1133
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "couch"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
|
||||||
|
glium = "0.31.0"
|
28
src/main.rs
Normal file
28
src/main.rs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
extern crate glium;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
use glium::{glutin, Surface};
|
||||||
|
|
||||||
|
let events_loop = glutin::event_loop::EventLoop::new();
|
||||||
|
let wb = glutin::window::WindowBuilder::new()
|
||||||
|
.with_title("Couch Game Engine");
|
||||||
|
let cb = glutin::ContextBuilder::new();
|
||||||
|
|
||||||
|
let display = glium::Display::new(wb, cb, &events_loop).unwrap();
|
||||||
|
|
||||||
|
events_loop.run(move |ev, _, control_flow| {
|
||||||
|
|
||||||
|
let mut target = display.draw();
|
||||||
|
target.clear_color(0.0, 0.0, 1.0, 1.0);
|
||||||
|
target.finish().unwrap();
|
||||||
|
|
||||||
|
let next_frame_time = std::time::Instant::now() +
|
||||||
|
std::time::Duration::from_nanos(16_666_667);
|
||||||
|
*control_flow = glutin::event_loop::ControlFlow::WaitUntil(next_frame_time);
|
||||||
|
if let glutin::event::Event::WindowEvent { event, .. } = ev {
|
||||||
|
if event == glutin::event::WindowEvent::CloseRequested {
|
||||||
|
*control_flow = glutin::event_loop::ControlFlow::Exit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user