Re: [AD] Fw: Acquire/Release speed issue

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


> Here things are not that easy: there is no "surface" for the real
> screen. You can directly get the framebuffer pointer, and that's what
> is done to set up the screen BITMAP line pointers. So if I reuse it,
> it'll work like this:
>
> Assume page1 is the reused screen, and page2 is another page.
>
>                    Visible on display            Offscreen
>
> before flip:      page1 == screen               page2
>                    page1->line[0] = 0xA0000      page2->line[0] = 0xB0000
>
> If on flipping I copy the contents of page2 on "screen", I display it.
> But line pointers are still the same, so on the next frame the user
> will be assuming that page2 is on screen, so page1 is offscreen so it
> is valid to write on it... while page1 line pointers still point to the
> real screen, thus whatever the program draws will instantly overwrite
> the just copied page2 on the displayed screen.
>
> after flip:       page2                         page1 == screen
>                    page2->line[0] = 0xB0000      page1->line[0] = 0xA0000
>
> Here we're talking about a fullscreen mode where you have direct access
> to the screen... so tricks like the one you suggested won't work.
> Or am I missing something?

No, I am :-)  Under Windows, the line pointers are floating and are 
re-calculated on each locking, so you can easily swap.  Can't you simply 
swap them too on each flip?

Btw, the "==" doesn't mean pointer equality, only "point to the same 
surface".

-- 
Eric Botcazou




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