[AD] windowed mode

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


I want to implement windowed mode drivers for Windows in the near
future. There are several ways to do this:

1. Using hardware overlay
This would be the easiest way to implement a windowed mode including
full clipping, page flipping and perhaps scrolling! Unfortunately not
every gfx driver support overlays, moreover not in any resolution and
color depth.
For those of you who don't know overlays: Most modern gfx cards can
replace pixels of the screen with the contents of a video bitmap (the
overlay surface). There is absolutely no cpu overhead because this
replacement is done by the video card while generating the display
signal. To allow clipping overlays can be combined with color keying: by
setting the window background to this color key only visible pixels of
the Allegro window would be replaced.

2. Using implicit double buffering
This technique (often called software overlay) would blit the contents
of the screen bitmap onto the primary surface frequently by an
additional rendering thread. Although nearly every card supports
hardware accelerated blitting today, I don't expect that the performance
is very well.

3. Scanline buffering
To avoid to need to blit the whole window, we could blit whole scanlines
in the unwrite_line routine. This would avoid unneeded overhead. For
most application this would be faster than way 2. Of course in some
cases this would be horrible slow: a random pixel drawer would blit a
whole line for every pixel.

4. Direct primary surface access
This driver would return pointer to the primary surface memory as long
as a scanline is completely visible. If it isn't a pointer to software
buffer would be returned. After the unwrite_line call this buffer would
be blitted to the primary surface.
The advantage of this way is that video memory access is very fast as
long as the screen is completely visible. This is the case for most of
the time. Otherwise the clipping would still be ok.
The only problem is to find out which scanlines are completely visible.
There is a api in DirectDraw (clippers) to find out which parts of the
window are visible, but there is no api that would tell the application
that the visible parts have been altered. I hope that this is possible
by hooking some window messages.


How is the windowed mode driver implemented in XWinAllegro? I guess that
there is neither direct video memory access in XWindows nor overlay
support. Does is use any kind of double buffering system?


--
      o Stefan Schimanski
  ( )   1Stein@xxxxxxxxxx
o       http://1Stein.home.pages.de




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