[AD] iOS multiple screen support plans

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


I've added support to the iOS port for hot-pluggable (I've only tested with 1 extra screen) monitors. It works wirelessly and with a cable. I just wanted to see if anyone had anything to say about other platforms and how this should affect them and how I can structure this patch so it'll be friendly if and when other platforms implement this feature.

The major points so far are:

- Two new events: ALLEGRO_EVENT_DISPLAY_CONNECTED and ALLEGRO_EVENT_DISPLAY_DISCONNECTED
- A new bitmap flag: ALLEGRO_PRESERVE_TEXTURE

The events are pretty self explanatory. The flag makes the iOS port (and some portions of the base library and OpenGL driver) behave like the d3d driver. When a bitmap is locked or set as the target, it's marked as dirty. Bitmaps with this flag have a non-null bitmap->memory pointer which holds the bitmap data in system memory. When the display is flipped, dirty bitmaps with this flag are backed up to system memory.

There are performance issues if you use this, but in my tests with a game that uses hundreds of bitmaps, it doesn't appear to slow anything down much on a 1st generation iPod touch.

The reason for the need for the system memory backups is that a display can be detached at any time without any notice  which immediately invalidates the graphics memory (or so it appears in my tests, which is why I added this flag after writing the rest and finding my images were all corrupt after unplugging a screen.)

Any thoughts?





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