Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to request quit #101

Open
OvermindDL1 opened this issue Dec 26, 2020 · 4 comments
Open

Call to request quit #101

OvermindDL1 opened this issue Dec 26, 2020 · 4 comments

Comments

@OvermindDL1
Copy link

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
Copy link
Author

OvermindDL1 commented Dec 26, 2020

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).

@Pebaz
Copy link
Contributor

Pebaz commented Jan 23, 2021

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

@musjj
Copy link

musjj commented Apr 15, 2024

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

@ozymandiaslone
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants