1) I have noticed some functions that are meant to query a boolean property are named al_is_* while some are called al_get_*.
I've checked whether those following the al_get_* pattern have corresponding al_set_* functions (as it might be nicer to have al_get_*/al_set_* than al_is_*/al_set_*), but that wasn't alyways the case.
The ones that are called al_get_... without corresponding al_set_... colleagues are:
al_get_timer_started
al_get_joystick_active
al_get_haptic_active
al_get_sample_instance_attached
al_get_mixer_attached
al_get_audio_stream_attached
The ones with corresponding setters are:
al_get_thread_should_stop
al_get_voice_playing
al_get_sample_instance_playing
al_get_mixer_playing
al_get_audio_stream_playing
2)
Another very minor API inconsistency concerns the "platform specific functions":
All of them seem to follow an (unusual) al_-platform-_verb_...-pattern (e. g. al_osx_get_window), but one exception:
al_get_win_window_handle.
Note that the D3D/OpenGL functions, too, follow the al_-verb-_opengl_* and al_-verb-_d3d_* patterns respectively.
Thus, the only function names that don't follow the al_verb_...-pattern are:
"platform specific functions" - except al_get_win_window_handle
al_ustr_*, al_utf8_*, al_utf16_*, al_ref_*, al_cstr
al_color_*
file I/O, memory management and fixed point maths are different beasts anyway
I thought I'd post it here for comments.
By the way: The prototype for al_do_multiline_text is mysteriously absent from the docs page. How do I resurrect it?
Edit: Nevermind, the culprit was a space in addons/font/text.c:544.
Thanks for going through those! Some of those are indeed poorly named, and could stand for a revision. I think we'll be able to start deprecating some of the worst names in the next stable release. I've added this thread to my TODO list.
Edit: Nevermind, the culprit was a space in addons/font/text.c:544.
This is now fixed.
Talking of inconsistencies...
why is
al_fgets(file,buffer,size)
different to
fgets(buffer,size,file)
??
Because we didn't want to clone the original libc api. Its more important for allegro's api to be consistent with itself than with similar external APIs. Allegro tends to go with the object it is operating on as the first parameter.
Because we didn't want to clone the original libc api.
While that's true, it's slightly confusing we copy the function name, but not the argument ordering.
Maybe a macro would be useful:
#define al_fgets_t(b,s,f) al_fgets(f,b,s)