Re: [AD] Making the projection transform bitmap local

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


On Wed 01 Apr 2015 10:52:55 PM SiegeLord wrote:
> The projection transform being display-local has been a wart in Allegro
> for quite a long time. Unlike every other global state, the projection
> transform was extremely volatile... if you looked at Allegro wrong, it
> would reset it to orthographic... the only practical way of using it is
> to reset it to the desired transformation pretty much all the time
> before drawing. There is in fact a bug about this
> http://sourceforge.net/p/alleg/bugs/349/ submitted by myself 3 years ago
> which involved the font addon not properly restoring it after it was
> clobbered by an intra-addon al_set_target_bitmap call.
[snip]
> 
> Some migration notes:
> 
> al_get_projection_transform(display)
> 
> changes approximately to (might need to insert a al_set_target_bitmap()
> call):
> 
> al_get_current_projection_transform()
> 
> 
> al_set_projection_transform(display, &trans)
> 
> changes approximately to (might need to insert a al_set_target_bitmap()
> call):
> 
> al_use_projection_transform(&trans)
> 
> That said, in principle you should be able to remove many
> al_set_projection_transform calls altogether if all you were doing is
> resetting them every frame. Now you can just set it and forget it
> (except for the two cases outlined above).

I'm concerned this is a api/abi breakage. It looks like you've completely 
removed the old set/get functions. Are they only in 5.1 and can actually be 
removed like this?

Would it break too much if they still existed, but behaved similarly, and only 
acted on the backbuffer's local projection? Just so people who use them don't 
immediately break? We can always tag them as deprecated 
(__attribute__(deprecated) ftw) and slated for future removal.

> Some implementation notes:
> 
> The display retains a cached 'projview' transform for the purposes of
> shaders, but otherwise everything is set up in the update_transformation
> method in the ALLEGRO_DISPLAY_INTERFACE.
> 
> -SL


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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