Smooth scrolling

Whenever the “smooth scrolling” topic appears, the reply is “use
OpenGL”.
It makes sense, since a 3D accelerator can draw a few textured quads
really fast.

But why is that faster than hardware-accelerated DirectDraw? In the DD
SDL version, don’t SDL_Surfaces wrap DD surfaces? Shouldn’t that be
as fast as, or faster than, OpenGL / Direct3D?

Thanks,
–Gabriel

Lic. Gabriel Gambetta
ARTech - GeneXus Development Team
ggambett at artech.com.uy

I can only speculate on this, as it’s highly driver and hardware
dependent. Possible reasons why DDraw is slower:

* You're not using h/w surfaces. (Should work anyway,
  but DMA from system RAM *is* slower, unless you're
  using a shared memory integrated video chipset.)

* You're not using h/w supported pixel formats.
  (SDL_DisplayFormat() *should* work...)

* You're using alpha blending. (Not accelerated
  by DDraw.)

* OpenGL rendering is asynchronous on a full frame
  basis, whereas DDraw blocks on each blit due to
  locking of the display surface. (Just guessing...)

* The video card has a separate 2D accelerator
  that is slower than the 3D accelerator.

* The DDraw driver is broken in one way or another,
  and doesn't make use of the full power of the
  accelerator.

* SDL isn't doing what we expect it to.

* DDraw isn't doing what we (or SDL) expects it to.

* Various other things...

//David Olofson - Programmer, Composer, Open Source Advocate

.- Audiality -----------------------------------------------.
| Free/Open Source audio engine for games and multimedia. |
| MIDI, modular synthesis, real time effects, scripting,… |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Monday 17 November 2003 17.22, Gabriel Gambetta wrote:

Whenever the “smooth scrolling” topic appears, the reply is “use
OpenGL”.
It makes sense, since a 3D accelerator can draw a few textured
quads really fast.

But why is that faster than hardware-accelerated DirectDraw? In the
DD SDL version, don’t SDL_Surfaces wrap DD surfaces? Shouldn’t that
be as fast as, or faster than, OpenGL / Direct3D?