Back buffers

How do you create a back buffer to write to and then flip it to the primary
screen?

-Mongoose, WPI student majoring in Computer Science.

“Whenever you find yourself on the side of the majority,
it’s time to pause and reflect.” -Mark Twain

How do you create a back buffer to write to and then flip it to the primary
screen?

Pass SDL_HWSURFACE|SDL_DOUBLEBUF to SDL_SetVideoMode().

You aren’t guaranteed to get it, so check for those flags in the returned
surface. It only currently works in fullscreen modes (DGA and DirectX)

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Pass SDL_HWSURFACE|SDL_DOUBLEBUF to SDL_SetVideoMode().

You aren’t guaranteed to get it, so check for those flags in the returned
surface. It only currently works in fullscreen modes (DGA and DirectX)

Why do the demos print out
"You must be root to set fullscreen mode" ?
Why can only root set fullscreen–is it a requirement, or a feature?

Pass SDL_HWSURFACE|SDL_DOUBLEBUF to SDL_SetVideoMode().

You aren’t guaranteed to get it, so check for those flags in the returned
surface. It only currently works in fullscreen modes (DGA and DirectX)

Why do the demos print out
"You must be root to set fullscreen mode" ?
Why can only root set fullscreen–is it a requirement, or a feature?

This is a requirement of DGA – it tried to memory map real memory,
which is a protected operation on secure operating systems like Linux.

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec

Why do the demos print out
"You must be root to set fullscreen mode" ?
Why can only root set fullscreen–is it a requirement, or a feature?

This is a feature, of Unix.

Under Linux, and some other unix-like systems, the X server accesses /dev/mem
to get fullscreen mode.

Since giving anyone but root access to /dev/mem is really dangerous (even if
you don’t care about security), setting the binary suid is the only way to do
it.

(Well, you could do something like adding certain users to the group “mem”, and
"chown root:mem /dev/mem ; chmod 660 /dev/mem", but that would be too easy…)On Tue, Jul 06, 1999 at 11:43:29PM -0700, Dave Ashley wrote:


– Michael Samuel