What is shadow surface?

Hi

I notice there are 3 kinds of surface in the SDL src, Public surface,
Video surface and Shadow surface. I’m very confused about them. What r
they refer to? When to use each of them?

Thank you very much!

Max

Diqing Zhong wrote:

Hi

I notice there are 3 kinds of surface in the SDL src, Public surface,
Video surface and Shadow surface. I’m very confused about them. What r
they refer to? When to use each of them?

The video surface is (well, most of the time, but let’s say it is) the
real video surface (the one tht is displayed on the screen).
The shadow surface is a surface that is created between the real screen
and the application, in case the real video surface doesn’t support the
requested bpp/features.

When you create a window, SDL exposes the public surface, which is
either (depending on wether there is a shadow surface or not) the real
video surface or the shadow surface.

Stephane