Re: [AD] OS X full screen resize (was Re: Allegro 5 TODOs (from wiki))

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Thu, Dec 11, 2008 at 4:31 PM, Evert Glebbeek <eglebbk@xxxxxxxxxx> wrote:
> Personally, I think my fix (moving the bitmap-relocation code into
> destroy_display) is the correct way to do it because it's robust and
> simple, but it does subtly break the design objective of putting
> create/destroy operations on the main thread (subtly, nothing is
> destroyed in transferring the bitmaps to another display). So an
> alternative fix might be to make it possible reuse the context from
> another thread.
I found that some parts of the window creation process _had_ to be
done on the main thread, so given that it had to be done sometimes, it
seemed a neat way do synchronisation by serialising everything to the
main thread. However Allegro has turned out 'more multithreaded' than
I thought it would be, so some mutexes will need to go back in (one
thread iterating through displays while another thread is
creating/destroying them is a good example)

IIRC from Apple's docs*, one thread per GL context should be perfectly
OK, but if you have >1 thread on the same context you need to do your
own locking. However it seems to suggest that the problems are just
visual, not crashes. I haven't checked but if you're saying that 2
threads can't draw to 2 separate ALLEGRO_DISPLAYS then we must have
made a mistake somewhere in the code.

Pete
* I remember reading something that wasn't quite this:
http://developer.apple.com/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_threading/chapter_12_section_1.html#//apple_ref/doc/uid/TP40001987-CH409-SW1




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/