Hardware Acceleration in Windowed mode

Pete Shinners wrote:

No hardware acceleration for windowed surfaces? Will this be fixed in
SDL1.3?

AFAIK, no. Windows doesn’t support it - and cannot, without hardware
based clipping. DirectX allows you to blit to the “screen” surface of a
window and does clipping internally, but if you were allowed to lock the
surface and access VRAM directly, you’d have to deal with clipping
yourself not to overdraw other windows, mouse pointer (unless it’s a
hardware sprite), menues etc.

actually, with directx you get great hardware support
for windows. this shouldn’t be too surprising, after all
you can also get accelerated and doublebuffered opengl
windows.

directdraw does provide you with hardware clipping controls,
when you create a hardware accelerated directx window, you
also create a hardware clipper, that you let windows
control for you. if you don’t create that clipper you
overwrite other windows on the screen. since you let windows
take control of the clipper, you really don’t need to mess
with it, although it looks like you can if you want to do
your own special clipping.

i’ve always thought the reason there was no support for
hardware acceleration for windows was you run into more
frequent problems with windows “losing” your surfaces?
but i’ve never really been sure.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

IMHO, I think SDL needs hardware acceleration in a window very badly. The
performance drops from 100FPS+ to <50FPS when I switch from fullscreen to
windowed. What are the problems with this, and the pros and cons?

IMHO, I think SDL needs hardware acceleration in a window very badly. The
performance drops from 100FPS+ to <50FPS when I switch from fullscreen to
windowed. What are the problems with this, and the pros and cons?

It’s simply impossible to do hardware page flipping in windowed mode.
It is technically possible to do accelerated blitting in a window, and
this will be addressed in the SDL 1.3 API rewrite.

BTW, you’re welcome to dig into the code and submit a patch for SDL 1.2
to enable hardware acceleration in a window, if it doesn’t change the API.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment