diff options
Diffstat (limited to 'source/dw/app/lop.rs')
-rw-r--r-- | source/dw/app/lop.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/dw/app/lop.rs b/source/dw/app/lop.rs index af3e81c..928ddf1 100644 --- a/source/dw/app/lop.rs +++ b/source/dw/app/lop.rs @@ -1,18 +1,25 @@ // Copyright 2023 Gabriel Jensen. -use crate::dw::app::App; +use crate::dw::app::{App,GOTINT}; use crate::dw::app::Gfx; //extern crate gl; extern crate glfw; -use glfw::{Context}; +use std::sync::atomic::Ordering; impl App { pub fn lop(&mut self,gfx: &mut Gfx) -> i8 { eprintln!("entering main loop"); while !gfx.win.should_close() { + unsafe { + if GOTINT.load(Ordering::Relaxed) { + eprintln!("got interrupt"); + gfx.win.set_should_close(true); + } + } + gfx.glfw.poll_events(); } |