Re: [AD] API review: iphone specifics

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


On 28 January 2013 13:16, Peter Wang <novalazy@xxxxxxxxxx> wrote:
Hi,

Getting the ball rolling.
 
Not a huge deal in of itself, but I'm afraid that people will start
requesting it for other platforms, too (and not just mobile).

Perhaps a tangent, and perhaps more than the scope of the question, but I was thinking about how this problem might be dealt with more generally. 

# Have an "iphone" and "android" addon, which can support specific features for the iphone.
  * Pros:
    * Could provide a C API to Obj-C/Cocoa functionality. I.e. a C abstraction layer on OS/system API.
    * iOS events and system could be supported without worry about other platforms. So dealing with the differences between the platforms is easier.
  * Cons:
    * Features may get out of sync with other platforms. I.e. number of features and how they are implemented, *but* this may also make the implementation easier and more consistent for the platform.

# Have a system like GL extensions, perhaps a "extensions" addon? For each feature (like battery level), you would query the system to see if it provides it for that platform. If so, you can call the API.
  * Pros:
    * Simple to add different extensions and experimental extensions.
    * Easy to deal with different API versions. Can have different named extensions, e.g. different iOS versions.
  * Cons:
    * Might be tricky to manage if lots of different competing extensions get added.

# Have a "device" add-on, which monitors various system properties, like battery level, memory, and you could query values via the API, and/or subscribe to getting events, like with devices and events in Allegro. You might also query this for things like screen size and screen DPI (which is useful for calculating font sizes device independently).


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