Out of curiosity, and on this ui/frontend topic, when opengl writes the graphics for a layer, would a person without access to the source code be able to have opengl write another layer (live), like the layer above or below it, in, say, a separate window, and is this kindof how stonesense works? And if so how easy or extremely complicated would it be to have it write this layer (using the same graphics as vanilla DF or whatever tileset one has installed in game?
Kindof like when you're in adventure mode and you see the little subwindow when you're next to a higher elevation that lets you see what's visible. Can only Toady or someone make it render this?
Sorry for random question of the day.
First off I think I should clarify that opengl is an inherently 3D system, so anything it does is rendered to a 3D scene, and so anything 2D using opengl is just being clever with the chosen projection. If you want to do native 2D layering, it's going to need to use something else (probably software-based). Both SDL (what DF uses) and Allegro (what stonesense uses) provide abstracted interfaces to the graphics hardware, as well as software-based 2D. SDL and Allegro both have a concept of a "layer" (broadly speaking) but getting each one to understand what the other one means would be a bit difficult.
Along the lines of what I think your intent was, however, Japa I know has been poking around with the DFHack folks, looking at ways to take over some section of the DF window (probably the standard view), and do that you're talking about for a while now. DFHack already has the capability to swap out tiles rendered to each of the DF areas, but arbitrarily reassigning that area (to, say, a frame of stonesense rendered in another thread) isn't currently possible (I think). That said, the SDL code for stonesense is openly available (and is in fact how DFHack inhabits the same address space as DF now), so directly going in and wiring it in would be the correct direction to take there.
In the end I'm pretty confident that that's possible, and I know Japa's been interested in that direction in the past, but it is, once more, probably a lot of work to do. I've recently gotten some experience working with SDL though, so maybe next time I'm poking around with the code I'll try to figure out if there's a shortcut somewhere, since yeah, that would be the most straightforward course of action to take to get stonesense using the DF ui.