Allegro 5.1.6 released!
Peter Wang


Changes from 5.1.5 to 5.1.6 (March 2013)

The main developers this time were: Trent Gamblin, Paul Suntsov, Peter Wang.


- Fix use of clobbered return value from setlocale() on X11.

- Register system interface even if no display driver available on Windows.

- Fix use of double math functions for float arguments (Nick Trout).


- Revamped shader API. The shader API is now part of the core library,
and the shader addon removed.

- Shaders are now a per-bitmap property, set with al_use_shader.
A bitmap without a set shader uses a default shader internally,
that allows Allegro drawing functions to work as in non-programmable
pipeline mode.

- Shader variable setters operate on the shader of the target bitmap.


- Rename al_link_shader to al_build_shader.

- Remove al_set_shader.

- Remove the al_set_shader_*_array functions. These functions cannot
be easily (or at all) implemented with the D3D backend.

- Add al_get_shader_platform and al_get_default_shader_source.

- Remove al_get_opengl_program_object, al_set_opengl_program_object,
al_get_direct3d_effect, al_set_direct3d_effect.

- Remove Cg shader backend.

- Add macros for shader variable names (Jon Rafkind).


- Made al_get_display_mode return the closest thing to a pixel format
possible with the WGL driver (tobing).

- Move WGL context destruction out of the message pump thread and into
the user/main thread.

- Allow command-tab to work in fullscreen window mode on OS X.

- Remove "user_reload" parameter from al_acknowledge_drawing_resume.

- Don't crash in al_create_display if there is no display driver.

- Don't crash at shutdown if there is no display driver (Windows).

- Don't fail init if both D3D, GL drivers unavailable (Windows).

- Sync bitmaps before resizing display to prevent changes being lost
after the resize (D3D).

- Load the D3D9X module during display creation and unload it when the
D3D system shuts down.

- Run fullscreen toggle on main thread (OS X).

- Destroy the backbuffer bitmap when destroying the display (OS X).

- Switch to new NSTrackingArea API (OS X).

- Set ALLEGRO_NO_PRESERVE_TEXTURE on backbuffer (OpenGL).


- Let al_destroy_bitmap implicitly untarget the bitmap on the calling

- Fix a bug where bitmap locking may change the target bitmap but
not restore it back to NULL (OpenGL).

- Use memory bitmap drawing when either bitmap is locked (OpenGL).

- Fix a crash in D3D destroying sub-bitmaps.

- Add const qualifiers to glUniform*v() functions (Aaron Bolyard).


- Partially fix mouse buttons "sticking" on Mac, e.g. holding the
mouse and toggling fullscreen window.

- al_set_mouse_xy on Windows resulted in the mouse getting set to the wrong
position in windowed modes

- Scale the user supplied mouse cursor if it's too big (Windows).

- Add key constants for some Android keys, those that are used in Xperia
Play controls.

Audio addons:

- Fix PulseAudio driver trying to connect to a non-existent server forever.

- Avoid memory leaks with audio event source.

- Use smaller buffer size for OpenSL.

Image addon:

- Use Allegro built-in loaders in preference to OS X loaders for BMP/TGA/PCX.
The OS X TGA loader doesn't support alpha and this is also more consistent.

Font addons:

- Make al_init_font_addon return success value.

- Make al_init_ttf_addon return true for subsequent calls.

Native dialogs addon:

- Fix a crash on iOS due to threading/TLS issues geting the display
(Nick Trout).

Primitives addon:

- Speed up al_triangulate_polygon_with_holes.

- Speed up drawing of the rounds for polylines.

- Add custom vertex attributes to the primitives addon.

- Replace vertex shader binary generated by vsa.exe (removed from DirectX
SDKs for a while now) by that generated by fxc.exe.

- A minor revamp of the HLSL default shader system in the primitives addon.

- Fix a few incorrect usages of al_lock_vertex_buffer

- Disallow 3 component vectors for ALLEGRO_PRIM_TEX_COORD.

- Add a whole bunch of new ALLEGRO_PRIM_STORAGE values.

- Primitives addon was ignoring the filter settings of textures in the D3D

Android port:

- Generate KEY_CHAR on Android.

- Add key constants for Android.

- Set target bitmap to display backuffer after program is resumed.

- Use different functions for OpenGL ES 1 and OpenGL ES 2 on Android.

iOS port:

- Support stencil buffer on iOS.

- Remove unnecessary autorelease pools. There was a crash when using
Airplay that goes away without the pools.

- Make Airplay work the standard way most apps do unless the
Allegro user explicitly creates a display on the second screen.

- Don't autorotate displays other than device.

- Fix some threading and memory issues.

Raspberry Pi port:

- Allow for color size, depth and stencil sizes.

- Support al_show_mouse_cursor and al_hide_mouse_cursor.
Disabled as it sometimes ends up stuck on the screen until reboot.


- New examples: ex_prim_shader, ex_shader_target.


- Various documentation updates.

- Minor fixes and code refactoring.

c93c2b7fe82e9badf67f417fa40fae3f  allegro-
e6196c5a7911b3c0f8fc3806ce6b5b5e  allegro-5.1.6.tar.gz


Looking good, well done and thanks to all the contributors. I look forward to putting the improved library to the test very soon.


Thanks for another great release!

I noticed the Cg shader backend was removed. I sort of liked the idea of having unified and cross-platform shaders. Were there any implementation issues? Just wondering why this feature was dropped.

Mark Oates

Revamped shader API. The shader API is now part of the core library, and the shader addon removed.

Woah, cool.


You guys are awesome.

I haven't been able to compile Allegro on windows so far, so it would be immensely appreciated if someone could provide binaries for msvc-11.0.

simast said:

Just wondering why this feature was dropped.

Nobody was using it, the implementation was incomplete and nobody was around who wanted to maintain it.

Michał Cichoń

Build for Windows is ready.

Thank you! I really appreciate it.

Edgar Reynaldo

Yeah, definitely. That's awesome. Thanks again guys! DL'ed.


I think these binaries were compiled without shader support (see this thread). Looking at the allegro5/platform/alplatf.h in the binaries I see these two lines:


Those two were renamed sometime between 5.1.5 and 5.1.6, so they should now be:



How can it not have shaders if shaders are now part of the core? Shouldn't they be implicit now?


They are in the core, but you can still disable them. You can even disable OpenGL support altogether under Windows.

Michał Cichoń
SiegeLord said:

Those two were renamed sometime between 5.1.5 and > > 5.1.6, so they should now be:


Ups. I will post an update on Firday, since I do not have access to my dev machine right now.

Mark Oates

Michał, how do you build the binaries? What type of machine are you on and what process do you usually go through?

Michał Cichoń

I'm using Lua, Code::Blocks and directory filled with toolchains. That's short story.

I did wrote a build script two or three years ago to generate Code::Blocks projects with all configurations I found suitable for releases. There are many configurations one with static runtime, shared runtime but static standard library etc. I did that once by hand and that was horrible to maintain. One new preprocessor definition and you need to go trough more than 100 configurations. 8 per project, 12 project (core, addons, monolith), N toolchains (usually 7). So... the script.

I made it once. Now I'm tracking changes between releases and adding new files, new flags while maintaining backward compatibility. If I'm off from Allegro a little longer I miss some discrete changes like ALLEGRO_CFG_SHADER_GLSL rename.

Back to question. Process is rather simple:

  • take diff stat between two releases

  • reexamine configuration files

  • reflect changes to the scripts (adding few new files usually)

  • generate code project (this is what script does)

  • build (40m on i7, this is batch build)

  • pack (extract headers and binaries then zip them, this is script also)

  • upload to FTP

  • publish on Allegro Forum

You may ask why I'm not using CMake to do everything. At that time I know almost nothing about it and even today adding custom toolchain is black magic there. Only basics are covered by documentation.
Therefore I maintain my little Allegro specific build system, where I can control how toolchain is invoked and be responsible for bugs, so I can fix them.

I guess that's whole story.


Does this update fix the issue with some programs crashing whenever you attempt o draw a bitmap to the screen(al_draw_bitmap_region(...);) on Windows 7? (My laptop has this issue and it shouldn't considering i used the installer(?)) When i had used allegro for my prgramming class, on the school computers it works fine and for everyone else it works fine, but i can't get the program to draw to the screen without it throwing out errors and throwing a fit. It complains with multiple "incompatibilities" and i wish i could get some help from someone?

Peter Wang

"the" issue? You make it sound like a known issue that everyone would be aware of. Provide a test case.

Michał Cichoń

OK. I updated Windows packages. Allegro is now compiled with shader support as promised.
Please enjoy.

Jeff Bernard

"the" issue? You make it sound like a known issue that everyone would be aware of. Provide a test case.

It's almost 100% not an Allegro issue. Here's his thread on it. He referred to a bitmap by absolute path, but hasn't yet returned to the thread to see if using relative paths will fix his problem.

Edgar Reynaldo

Sweet!!!~~~~~ Just built SVN too

Thomas Fjellstrom

Sweet!!!~~~~~ Just built SVN too

Geeze I hope not. That hasn't been used in a while. I wasn't aware the SVN repo still existed to be honest.

Edgar Reynaldo

Bah! I forgot you guys switched to git. You're screwing me all up... Now I have to learn how to actually use something! TortoiseSVN is so nice....


OK. I updated Windows packages. Allegro is now compiled with shader support as promised.
Please enjoy.

Oh, for sure. Thanks for compiling!

TortoiseSVN is so nice....

What about TortoiseGit then?


Doesn't GitHub provide an archive of the head revision?


Allegro is hosted on sourceforge, not github. Sourceforge doesn't have this feature (it seems to have been disabled). That said, Elias has a mirror that's hosted on github where this trick will work:

Edgar Reynaldo

What about TortoiseGit [] then?

Ooh, I'll install that one soon! Thanks!~


Thanks for the hard work!

However, shaders don't work for me on my older desktop Linux. :'(
It does work on my newer linux laptop. Perhaps my driver is buggy or outdated? Or perhaps my graphics card is too old?

Anyway, for example, if I run ex_shader I get:

File r300_state.c function r300SetupRSUnit line 1522 Don't know how to satisfy InputsRead=0x0000c000 *************************************************************************** Segmentation fault

It's the same for other shader-related programs, I also get
something like this when I run ex_opengl_pixel_shader (and others):

ex_opengl_pixel_shader: radeon_texture.c:121: radeon_teximage_map: Assertion `!image->base.Data' failed.

Some system information:

1$ uname -a 2Linux kuma 2.6.32-41-generic #88-Ubuntu SMP Thu Mar 29 13:08:43 UTC 2012 i686 GNU/Linux 3 4$ lspci 5---8<---- 601:05.0 VGA compatible controller: ATI Technologies Inc RS690 [Radeon X1200 Series] 7---8<---- 8 9$ glxinfo 10name of display: :0.0 11display: :0 screen: 0 12direct rendering: Yes 13server glx vendor string: SGI 14server glx version string: 1.2 15server glx extensions: 16 GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 17 GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 18 GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control, 19 GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 20 GLX_SGIX_visual_select_group 21client glx vendor string: Mesa Project and SGI 22client glx version string: 1.4 23client glx extensions: 24 GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 25 GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_allocate_memory, 26 GLX_MESA_copy_sub_buffer, GLX_MESA_swap_control, 27 GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_OML_sync_control, 28 GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync, 29 GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 30 GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap 31GLX version: 1.2 32GLX extensions: 33 GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 34 GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 35 GLX_MESA_swap_frame_usage, GLX_OML_swap_method, GLX_SGI_make_current_read, 36 GLX_SGI_video_sync, GLX_SGIS_multisample, GLX_SGIX_fbconfig, 37 GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 38 GLX_EXT_texture_from_pixmap 39OpenGL vendor string: DRI R300 Project 40OpenGL renderer string: Mesa DRI R300 (RS690 791E) 20090101 x86/MMX+/3DNow!+/SSE2 NO-TCL DRI2 41OpenGL version string: 1.5 Mesa 7.7.1 42---8<----

Thread #612274. Printed from