Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » File Change event

This thread is locked; no one can reply to it. rss feed Print
File Change event
roger levy
Member #2,513
July 2002

It would be nice to be able to get file change events from the OS in order to live-update loaded assets so you can create them in an external program with instant feedback.

Chris Katko
Member #1,881
January 2002
avatar

Can't be that hard to make an addon.

https://stackoverflow.com/questions/931093/how-do-i-make-my-program-watch-for-file-modification-in-c

https://lwn.net/Articles/604686/

But I wouldn't hold my breath for Allegro library changes unless you took the initiate and wrote them yourself.

I definitely agree it's useful and worthy of addition.

I've long been of the belief that Allegro shouldn't just focus on being a "game" library, but also a "game tool" library because any moderate-sized game will have dedicated tools (at very least, a level editor) and it would make no sense to have Allegro run your game... and have to resort to another library like SFML or SDL to write your tools. The goal is "making games", and tools are an essential part of that. It would be nice-as-heck to be able to load an "Allegro" context into a "frame" of a native GUI application so you could use normal Windows/QT/Linux/whatever buttons instead of having to build your own GUI from scratch or learn someone else's library.

I mean, you're on an OS right now with native GUI elements like buttons. Why would you re-invent the wheel? At the very best case, you're undertaking learning a non-standard API, or rolling your own, and going to hit an entire wall of bugs and edge cases--whereas you can literally just "drag and drop buttons" in Visual Studio, double click the button, and presto you have a callback function that gets called when you click it. No manual message handler. No timer routines. Not a damn thing because none of that is important and just represents "implementation details" (see: accidental complexity vs essential complexity). If you want a tree menu, you just drag-and-drop it in. Done. It works the same on every system, and every user automatically knows how to use it. Custom works great for simple, flashy interfaces. It's terrible for functional ones where people need to click thousands of times to build a level--the last thing they need is to be fighting a "mouse snap" of GUI elements that doesn't quick mimic the operating system they've spent tens-of-thousands of hours on.

But A.CC seems kind of "dead" lately, so I haven't really pushed for changes.

[edit] A quick look shows SDL and SFML don't have File Change notifications. I wonder if those libraries are better supported but don't have Allegro functions we're used to and enjoy. I've never had the time to do a thorough analysis or comparison between them.

[edit] Also, I wonder if 99% of questions have actually moved to Stack Overflow so there are Allegro users but we just don't hear from them anymore. But I've still yet to really see but a couple of games ever hit Steam that used Allegro.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs
"Political Correctness is fascism disguised as manners" --George Carlin

Audric
Member #907
January 2001

It would probably be easier to check the files (times) when you alt-tab back to the game, catching the event of getting the focus.

Go to: