Re: [AD] A few minor things

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


On Fri, 2010-04-16 at 18:53 -0600, Trent Gamblin wrote:
> 
> Looking for feedback on all of these things. If people
> agree they're useful I can come up with an API and see
> what everyone thinks of it then.
> 
> This could be a 5.2 set of features, I would have no
> problem with that.
> 

I think we should have all three.

For device orientation, it's enough if we can query the orientation and
get an event whenever it changes. Adjusting user input according to the
device orientation might not be wanted, so best leave it to the
application. It's trivial to do anyway. Same for automatic rotation of
graphics - with the transformation API that is trivial to do by the
user, and they might want to have fancy rotation effects on orientation
change which would interfere with any automatic rotation on Allegro's
part.


For the new inputs, I still think the best way would be to register all
devices as generic, named input devices with named arbitrary inputs as
discussed in that other thread. My reasons are still the same:

- I believe we can fully map all of the considered devices to them, so
we don't lose any functionality.

- It makes run-time detection much easier. Instead of having to read
through the documentation then query each of 10 different input devices
each with their own API you just query the list of generic devices at
runtime and display the names to the user. (Only if you want - you still
can always use specific devices of course, e.g. on IPhone.)

- Having custom APIs for all possible kinds of input devices may get out
of hand, code-maintenance wise

For things like force feedback, we also want to add outputs to those
devices... not sure how the API would look in detail.


For battery level, AJ's function looks good to me. I'd additionally like
an event:

ALLEGRO_EVENT_BATTERY_LOW

It could be in a new system events source (which could also generate the
orientation change events). Also could add this event, it's important on
IPhone:

ALLEGRO_EVENT_MEMORY_LOW

And there's several other system events I could think of, e.g. when an
application (not just a display) is paused or resumed.

-- 
Elias Pschernig <elias.pschernig@xxxxxxxxxx>





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