Simple question concerning SDL_CreateRGBSurface and SetVideoMode

The documentation of SDL_CreateRGBSurface states,
that SDLSetVideoMode has to be called before.

What if i want to only manipulate a surface without displaying it?
If i call SDL_SetVideoMode a display surface will always be shown.

If i call SDL_CreateRGBSurface without SDL_SetVideoMode the surface
gets allocated anyway, and i also can manipulate the pixel-map.

So why does it say: “must call SDL_SetVideoMode before” ?

Thx

Axel

This is a good question, which I would also like the answer to. I have
at least one app out there that uses SDL just to manipulate images with
no graphics displayed, and thus I don’t ever call SDL_SetVideoMode. It
hasn’t been a problem. Assuming you call it without SDL_HWSURFACE and
without needing a palette (is that actually a restriction?), are there
any platforms out there that this would cause problems on? It seems to
work fine on Linux/* and win32/i386.On Sun, Apr 09, 2006 at 03:35:14PM +0000, Axel wrote:

The documentation of SDL_CreateRGBSurface states,
that SDLSetVideoMode has to be called before.

What if i want to only manipulate a surface without displaying it?
If i call SDL_SetVideoMode a display surface will always be shown.

If i call SDL_CreateRGBSurface without SDL_SetVideoMode the surface
gets allocated anyway, and i also can manipulate the pixel-map.

So why does it say: “must call SDL_SetVideoMode before” ?


Steaphan Greene
GPG public key: http://www.cs.binghamton.edu/~sgreene/gpg.key.txt
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20060409/82318fc4/attachment.pgp

Hello !> On Sun, Apr 09, 2006 at 03:35:14PM +0000, Axel wrote:

The documentation of SDL_CreateRGBSurface states,
that SDLSetVideoMode has to be called before.

What if i want to only manipulate a surface without displaying it?
If i call SDL_SetVideoMode a display surface will always be shown.

If i call SDL_CreateRGBSurface without SDL_SetVideoMode the surface
gets allocated anyway, and i also can manipulate the pixel-map.

So why does it say: “must call SDL_SetVideoMode before” ?

This is a good question, which I would also like the answer to. I have
at least one app out there that uses SDL just to manipulate images with no
graphics displayed, and thus I don’t ever call SDL_SetVideoMode. It
hasn’t been a problem. Assuming you call it without SDL_HWSURFACE and
without needing a palette (is that actually a restriction?), are there any
platforms out there that this would cause problems on? It seems to work
fine on Linux/* and win32/i386.

You can use the Dummy Video Driver.

CU