Correct method for going into and out of full screen

For our mpeg4ip project (mpeg4 streaming video), we want to be able
to change screen sizes (double and halve video) and go into full screen.

We have been using the following:

This worked fine on both linux and windows.

We recently changed from SWSURFACE on our video mask to HWSURFACE. However,
when we change from full screen back to the regular size, we are
getting a DDERR_PRIMARYSURFACEALREADYEXISTS from the IDirectDraw2_CreateSurface

I’ve tried setting dd_surface1 from IDirectDraw2_GetGDISurface, but then
the IDirectDraw_Release fails with a value of 2.

Anyone got any ideas ? Am I using SDL beyond it’s capabilities ?

Bill May
cisco Systems