init commit

This commit is contained in:
Dane Johnson 2022-04-06 16:44:21 -05:00
commit 9a33becab8
4 changed files with 1170 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/target

1133
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

8
Cargo.toml Normal file
View 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
View 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;
}
}
});
}