[AD] [ alleg-Bugs-2951432 ] No clipping with sub-bitmap if (x <= 0 && y <= 0)

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


Bugs item #2951432, was opened at 2010-02-13 23:56
Message generated for change (Settings changed) made by elias
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2951432&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 4.9
Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: fbueren (fbueren)
Assigned to: Nobody/Anonymous (nobody)
Summary: No clipping with sub-bitmap if (x <= 0 && y <= 0)

Initial Comment:
When calling al_create_sub_bitmap(al_get_backbuffer(),  x, y ... whatever...)
I get no clipping at all if  (x <= 0 && y <= 0) . 
Seems to work as soon as  x > 0 || y > 0.

Tested under Linux.

----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2010-02-18 22:30

Message:
Thanks a lot, made it easy to spot - the problem was a bug in the OpenGL
driver. It should be fixed in SVN revision12928 . 

----------------------------------------------------------------------

Comment By: fbueren (fbueren)
Date: 2010-02-14 21:45

Message:
Okay, I think this should clarify (using Allegro 4.9.17, Linux):

First, you see the desired behavior (two squares, one yellow, one blue on
white background).
Now change the comment on the two lines creating *sub1.

Desired: same result as before.
Happens instead: Background yellow. The first clear on sub1 is not clipped
to sub1.

Hope this helps.

int main(int argc, char **argv)
{

    al_init();


    if(!al_create_display(640, 480)) return 1;

    al_install_keyboard();

    al_clear_to_color(al_map_rgb(255, 255, 255));

    ALLEGRO_BITMAP *sub1 = al_create_sub_bitmap(al_get_backbuffer(), 1, 1,
128, 128);
//    ALLEGRO_BITMAP *sub1 = al_create_sub_bitmap(al_get_backbuffer(), 0,
0, 128, 128);

    ALLEGRO_BITMAP *sub2 = al_create_sub_bitmap(al_get_backbuffer(), 100,
100, 128, 128);

    if(!sub1 || !sub2) return 2;

    al_set_target_bitmap(sub1);
    al_clear_to_color(al_map_rgb(255, 255, 0));

    al_set_target_bitmap(sub2);
    al_clear_to_color(al_map_rgb(0, 0, 255));


    al_flip_display();


    ALLEGRO_KEYBOARD_STATE kbstate;
    al_get_keyboard_state(&kbstate);
    while(!al_key_down(&kbstate, ALLEGRO_KEY_SPACE))
        al_get_keyboard_state(&kbstate);

    al_destroy_bitmap(sub1);
    al_destroy_bitmap(sub2);

    return 0;
}


----------------------------------------------------------------------

Comment By: Elias Pschernig (elias)
Date: 2010-02-14 15:53

Message:
Thanks for your report. I looked at ex_subbitmap and couldn't notice a
problem, but I think I fixed this in SVN anyway. It seems some checks in
al_create_sub_bitmap where only done for memory bitmaps and not for the
back buffer. Still I'm not entirely sure it's fixed, so can you be a bit
more specific about the problem you encountered?

1) What did you do? (If possible attach a short test case, other at least
a few complete lines of code - we need something to reproduce it here and
the easier you make it for us the better.)
2) What did you expect to happen?
3) What did happen instead?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105665&aid=2951432&group_id=5665




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