Re: [AD] al_set_new_window_position

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


On Tue, 2008-09-23 at 17:53 -0400, Evert Glebbeek wrote:
> This function sets two static variables in display_new.c, which are  
> unused except for being returned when al_get_new_window_position() is  
> called.
> Is there any further intention of implementing these two functions,  
> or should they be dropped from the API (I think that would be a  
> mistake)? Implementing them will mean adding two parameters to the  
> create_display() method in the vtables.
> 

I think they were added to the API together with al_set_window_position.
Basically, the idea is that instead of:

display = al_create_display(...);
al_set_window_position(display, x, y);

you would use:

al_set_new_window_position(x, y);
display = al_create_display(...);

The advantage is, for example if you store the last position in a config
file, in the first case the window would first pop up on the wrong
position then move to the right one later. I remember that gvim did that
here for some time and it was really annoying.. when opening a file, the
window would show up, you click on text, and in the same moment it
repositions itself.

With al_set_new_window_position, the window would appear in the right
position from the start, and never move around except if the user moves
it.

Of course, it needs to be changed to use thread-local variables, and the
various display drivers should not just ignore it :P

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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