summaryrefslogblamecommitdiff
path: root/source/dw/app/lop.rs
blob: 928ddf192fbe7e3bac3752da59e1f4b9d1d30e77 (plain) (tree)
1
2
3
4
5
6
7
8
9

                                 
                                 




                        
                                





                                                   






                                                                       





                                               
// Copyright 2023 Gabriel Jensen.

use crate::dw::app::{App,GOTINT};
use crate::dw::app::Gfx;

//extern crate gl;
extern crate glfw;

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();
		}

		return -0x45;
	}
}