Hey folks,
I'm trying to implement Irrlicht for the first time in my already existing framework for a game which is maybe 25% complete. If it means anything, I've been working with SDL.
I separate my game functions in 3 classes: Input, Logic, and Render so far. they are created in main(), and then each is called in a the game loop (Input->perform, logic->perform etc...)
i have created an IrrlichtDevice pointer in main, and I'm assigning in the render function. It's probably a bad thing but I don't know for sure yet. I am trying to keep the game functions separate as much as I can.
My problem is, that after I implemented the first tutorial in my Render class, I can close the window created by Irrlicht, by my game still runs in the background.
I was wondering is there a way to check if the "x" has been pressed in the window, so i can tell my main() that the game is closing?
Newbie question
Re: Newbie question
If user clicks "X" or uses key combination (alt+f4), than irrDevice->run() (that is used in while() condition in the main game loop) will return false.finky45 wrote: I was wondering is there a way to check if the "x" has been pressed in the window, so i can tell my main() that the game is closing?