Surfaces without video screen

The documentation says that the CreateSurface functions should be called after SDL_SetVideoMode. What if I don’t want a SDL video screen? I have an idea to create SDL_Surface objects in memory and then save them to disc with some pointer swizzling tricks, but the program that would be doing this would be an editor, for which ordinary GUI widgetset design would be far simpler than SDL. Any workarounds available?

SDL_CreateSurfaceFrom ?On Wed, May 7, 2008 at 2:39 PM, Mason Wheeler wrote:

The documentation says that the CreateSurface functions should be called after SDL_SetVideoMode. What if I don’t want a SDL video screen? I have an idea to create SDL_Surface objects in memory and then save them to disc with some pointer swizzling tricks, but the program that would be doing this would be an editor, for which ordinary GUI widgetset design would be far simpler than SDL. Any workarounds available?

Hello !

The documentation says that the CreateSurface functions should be called after SDL_SetVideoMode. What if I don’t want a SDL video screen? I have an idea to create SDL_Surface objects in memory and then save them to disc with some pointer swizzling tricks, but the program that would be doing this would be an editor, for which ordinary GUI widgetset design would be far simpler than SDL. Any workarounds available?

If you don’t want to have SDL opening a window,
you can use the SDL dummy videodriver.

CU

In our project, we use SDL_CreateRGBSurface a lot without a screen
surface (in case one uses the dedicated server).

It’s only important that you define the format yourself.

Look at gfxCreateSurface() here:


And at getMainPixelFormat() here:

And the definition of mainPixelFormat here:

That works great this way.Am Mittwoch, den 07.05.2008, 12:39 -0700 schrieb Mason Wheeler:

The documentation says that the CreateSurface functions should be
called after SDL_SetVideoMode. What if I don’t want a SDL video
screen? I have an idea to create SDL_Surface objects in memory and
then save them to disc with some pointer swizzling tricks, but the
program that would be doing this would be an editor, for which
ordinary GUI widgetset design would be far simpler than SDL. Any
workarounds available?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Hello !

In our project, we use SDL_CreateRGBSurface a lot without a screen
surface (in case one uses the dedicated server).

It’s only important that you define the format yourself.

Look at gfxCreateSurface() here:
http://openlierox.svn.sourceforge.net/viewvc/openlierox/include/GfxPrimitives.h?view=markup
And at getMainPixelFormat() here:
http://openlierox.svn.sourceforge.net/viewvc/openlierox/include/Color.h?view=markup
And the definition of mainPixelFormat here:
http://openlierox.svn.sourceforge.net/viewvc/openlierox/src/client/AuxLib.cpp?view=markup

That works great this way.

I can confirm this, too. In some of my
own projects i used it that way.

But there maybe changes in the future,
that this may not work anymore.

So using the dummy videodriver is the safest thing,
you can do.

CU

Can’t you do:
SDL_SetVideoMode(0, 0, bpp, flags);
To avoid creating a surface and opening a window?

Jonny D> Date: Wed, 7 May 2008 12:39:06 -0700

From: masonwheeler at yahoo.com
To: sdl at lists.libsdl.org
Subject: [SDL] Surfaces without video screen

The documentation says that the CreateSurface functions should be called after SDL_SetVideoMode. What if I don’t want a SDL video screen? I have an idea to create SDL_Surface objects in memory and then save them to disc with some pointer swizzling tricks, but the program that would be doing this would be an editor, for which ordinary GUI widgetset design would be far simpler than SDL. Any workarounds available?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


Stay in touch when you’re away with Windows Live Messenger.
http://www.windowslive.com/messenger/overview.html?ocid=TXT_TAGLM_WL_Refresh_messenger_052008

Hello !

SDL_SetVideoMode(0, 0, bpp, flags);
To avoid creating a surface and opening a window?

No, the 0,0 case is for opening a window
as big as your current desktop resolution.

It was added as a hack, so that people can
open a window the same size as their desktop,
without knowing the current desktop size.

CU