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

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


The Windows windowed driver also emulates page flipping, and it does reuse
the screen like the fullscreen one.

With emulation how I did it, you have the real "screen" BITMAP, and each time you call create_video_bitmap(), it returns a new BITMAP. You draw into one of these, then show_video_bitmap() copies onto "screen". If I reuse
the screen, this doesn't work, as with emulation "screen" is always
displayed, no matter if you call show_video_bitmap() to flip pages...

The technique is to swap the underlying surfaces on each call to
show_video_bitmap()

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?

--
Angelo Mottola
a.mottola@xxxxxxxxxx





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