Basically, what I want to do is :
- capture the whole Dwarf Fortress screen (map AND gui on the side -- for now I'm not too worried about plugins additional windows, like Dwarf therapist and such) every once in a while (I've reduced my goals again: 5 times/sec ought to be enough)
- it needs to be a consistent state of the game (no half-rendered screen, with the upper part being the new frame, and the lower part the previous one!)
- then I run my own post-processing algorithm on the set of characters -- possibly in a separate thread.
- I have my own gui open alongside, where I ouput the results (by the way that will need to be graphical. I'll need to start looking at the way SDL can be initialized and used correctly in DFHack)
The reason why I'm reading only the final output (instead of trying to use fancy functions to get data directly from the game's core) is because I want my plugin to be as simple as possible, and to have a high maintainability. No matter what changes are made to data structure and stuff, it will still work as long as it can "read the screen", like a human. Maybe I'll reconsider that later. But for now I'm trying to whip together a quick prototype.
I'm bumping into sync problems: I don't know if the renderer class is meant to be used "as-is", and if there is concurrential access to its inner data -- or if I can just read it anytime.
I was told to get inspiration from DFTerm. But DFTerm is gigantic. DFTerm3 is in Haskell, and I'm totally unable to understand anything. DFTerm2 is in C++ -- I'll try to understand the design, but the synchronization methods are not usually what catches the eye when reading through. They're often partly implicit, if you get me.