KelvinShadewing / brux-gdk

Free runtime and development kit using SDL and Squirrel
GNU Affero General Public License v3.0
39 stars 20 forks source link

Implement a function-based loop system #61

Closed hexaheximal closed 1 year ago

hexaheximal commented 1 year ago

Previously, anything using Brux GDK would need to create a main loop which blocks the main thread.

Normally that's perfectly fine, but in a web browser blocking the main thread is something you should NEVER do.

The solution to this problem is to have the engine itself take care of the loop properly, and then the game just defines what should be run on each frame.

hexaheximal commented 1 year ago

Okay, quitGame works now. I was actually planning to sleep in this morning but then quickly got out of bed and went right to my computer upon realizing that I never got a change to force-push the fix so I could get that last fix force-pushed in as soon as possible.

Should be ready to merge now!

EDIT: Also, it looks like you pinged me on Discord regarding this since I got a notification email. (Discord doesn't even include the message contents in the email, which is really annoying) Please email me instead, as I'm not always able to use Discord.