I've got a couple questions about how allegro operates internally.
Basic info about my program - I have a multi-window application, with one allegro display to capture input using the RawInput API from win32, one to display logging output using allegro, and one display for each mouse cursor I create on the screen corresponding to each hardware mouse connected to the computer.
As I understand it, allegro creates a new thread for each display it creates to run the window process on (using Windows here for the moment).
Question 1) A single thread can have multiple displays created on it, correct? And each thread has a current display, correct? Is this part of the thread local storage I've heard of? How does that work exactly?
Quoting from al_set_target_bitmap :
Each video bitmap is tied to a display. When a video bitmap is set to as the target bitmap, the display that the bitmap belongs to is automatically made "current" for the calling thread (if it is not current already). Then drawing other bitmaps which are tied to the same display can be hardware accelerated.
A single display cannot be current for multiple threads simultaneously. If you need to release a display, so it is not current for the calling thread, call al_set_target_bitmap(NULL);
Question 2) Every bitmap has a display it is attached to, correct? Is this true for memory bitmaps too?
*Question 3) How does drawing work with multiple display threads running in parallel?
Question 4) Is there a way to detect the current display?
These questions are because of my other thread here :
My program crashes intermittently in al_set_target_bitmap. Sometimes it does, sometimes it doesn't. But it always crashes in the same place when it does.