sabo/general/engine.rs
1use glium::{
2 glutin::{
3 event_loop::{EventLoop},
4 },
5};
6use crate::{
7 general::{Context},
8 graphics::{Window},
9};
10
11
12/// The Engine is the meat and potatoes
13/// of the program. The end-user should
14/// only have to create this and pass in
15/// a map of scenes. Then, call the `run()`
16/// function.
17pub struct Engine {
18 running: bool
19}
20
21impl Engine {
22 /// Create the Engine.
23 pub fn new() -> Engine {
24 return Engine {
25 running: false,
26 }
27 }
28
29 /// Run the Engine. This houses the
30 /// updating and rendering of the game.
31 pub fn run(&mut self) {
32 self.running = true;
33 let event_loop = EventLoop::new();
34 let mut ctx = Context::new(&event_loop);
35
36 Window::update(&mut ctx, event_loop);
37 }
38}