macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

Call to request quit

Open OvermindDL1 opened this issue 4 years ago • 4 comments

Would be useful to have some call to request to quit the app (so close the program on desktops, exit application on mobile, stop processing on the web, etc...).

OvermindDL1 avatar Dec 26 '20 06:12 OvermindDL1

For note, I built a mini event-processing system in my main state that I inject events into, bit odd as I basically transformed the loop into an event processor that renders when a Render(delta) event comes through among all the other events that happen, but eh, it's much more familiar and efficient (and shorter than what was being done before).

OvermindDL1 avatar Dec 26 '20 06:12 OvermindDL1

@OvermindDL1 I achieved this by breaking out of the main loop. Alternatively, you could return out of it from a deeply nested loop.

Pebaz avatar Jan 23 '21 20:01 Pebaz

Also wondering about this. Is there a way to just request macroquad to clean up and close everything from any function?

musjj avatar Apr 15 '24 09:04 musjj

A quick and dirty hack I have done before is using std::process::exit(0) to quit the program from anywhere, but im not sure how it would behave in other environments like on the web. It also seems less than ideal because there seems to be a slight delay between when you call it and when the process actually closes.

ozymandiaslone avatar Apr 20 '24 19:04 ozymandiaslone