Full Screen under X11

Hi,
I’m pretty new to SDL and I really think this library is great :slight_smile:

Me and a friend are currently writing a RPG for Linux using SDL (he

know more than me about SDL) and we are using a 320x240 Screen Display.
You’ll probably agree with me that a 320x240 display under X whn most of
the Linux people run X with a resolution of 1024x768 is small :frowning:

 we tried to make it at 640x480 but since it's a scrolling

background this is to slow so we’re stuck with 320x240 .

I was curious to know if someone know how to make a Full Screen

display with SDL or something that could make our display bigger without
slowing down the performance.

Thanks
                                Cluster
Me and a friend are currently writing a RPG for Linux using SDL (he

know more than me about SDL) and we are using a 320x240 Screen Display.
You’ll probably agree with me that a 320x240 display under X whn most of
the Linux people run X with a resolution of 1024x768 is small :frowning:

Yup, I agree.

 we tried to make it at 640x480 but since it's a scrolling

background this is to slow so we’re stuck with 320x240 .

Yup, this is a problem.

I was curious to know if someone know how to make a Full Screen

display with SDL or something that could make our display bigger without
slowing down the performance.

Try adding SDL_FULLSCREEN to the flags when you set the video mode,
and then running your program as root. CAUTION: This may freeze
your display if you also specify SDL_HWSURFACE. I’m currently trying
to find the cause of this bug – it’s mouse cursor related.

Many people don’t have a 320x200 mode in their XF86Config, so be sure
and use SDL_ListModes() or SDL_GetVideoMode() to determine the best
video mode available.

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Many people don’t have a 320x200 mode in their XF86Config, so be sure
and use SDL_ListModes() or SDL_GetVideoMode() to determine the best
video mode available.

Not to speak of the fact that there are GFX-cards and X11 server
combinations that don’t support double-scanned (x200, x240 and similar)
modes. An example is Mach64 CT. Of course I own such a card. grrr:(

Bye,
Markus Gietzen–
Dipl. Informatiker(FH) Markus Gietzen
Author of XGenEM SEGA Genesis/Mega Drive Emulator

I was curious to know if someone know how to make a Full Screen

display with SDL or something that could make our display bigger without
slowing down the performance.

Try adding SDL_FULLSCREEN to the flags when you set the video mode,
and then running your program as root. CAUTION: This may freeze
your display if you also specify SDL_HWSURFACE. I’m currently trying
to find the cause of this bug – it’s mouse cursor related.

This bug is now fixed in the latest developer release of SDL (0.8c)

See ya!
-Sam Lantinga (slouken at devolution.com)–
Author of Simple DirectMedia Layer -
http://www.devolution.com/~slouken/SDL/

Hello,

When I call SDL_WM_ToggleFullScreen, I have an error… I run under
xfree 4.0.1, that it is supposed to be supported under X11

I do this:

if (!SDL_WM_ToggleFullScreen ( screen->surface ) )
{
DK_ERROR (“Toggle NOT done: %s”, SDL_GetError() );
return (FALSE);
}

but SDL_GetError doesnt give me any info (just a NULL string)

any help?

By the way, I tryed to kill the windowed surface and open a new one in
full screen. This is working, but when I return back again to X11, SDL
try to Flush all events and the system crashes. What is the correct way
to come back to X11? Do I need to grab the input in Full Screen?

Any suggestion will be apreciated.

Another issue is the SDL_ShowPointer (). Is There any way to know the
actual state of the pointer? The only way I know is reading the data
given by the last call to this function… but, any way to query this?
like the grabinput, that you can query is is ON or OFF…

thanks a lot, and I hope we can make this library robust and a real
choice for developers…–
signed
derethor of centolos

Try and avoid SDL_ToggleFullScreen, I believe it’s obsolete. Use the following
method:

Uint32 video_flags;
.
.
.
/* Setup video /
video_flags=SDL_HWSURFACE|SDL_DOUBLEBUF;
SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, video_flags);
.
.
/
Switch to fullscreen /
video_flags|=SDL_FULLSCREEN;
SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, video_flags);
.
.
/
Switch to windowed mode */
video_flags&=~SDL_FULLSCREEN;
SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, video_flags);
.
.On Thu, Nov 16, 2000 at 05:44:33PM +0000, Derethor wrote:

Hello,

When I call SDL_WM_ToggleFullScreen, I have an error… I run under
xfree 4.0.1, that it is supposed to be supported under X11

I do this:

if (!SDL_WM_ToggleFullScreen ( screen->surface ) )
{
DK_ERROR (“Toggle NOT done: %s”, SDL_GetError() );
return (FALSE);
}

but SDL_GetError doesnt give me any info (just a NULL string)

any help?

By the way, I tryed to kill the windowed surface and open a new one in
full screen. This is working, but when I return back again to X11, SDL
try to Flush all events and the system crashes. What is the correct way
to come back to X11? Do I need to grab the input in Full Screen?

Any suggestion will be apreciated.

Another issue is the SDL_ShowPointer (). Is There any way to know the
actual state of the pointer? The only way I know is reading the data
given by the last call to this function… but, any way to query this?
like the grabinput, that you can query is is ON or OFF…

thanks a lot, and I hope we can make this library robust and a real
choice for developers…


signed
derethor of centolos


Martin

Bother said the Moderator, &$&^%NO CARRIER

Martin Donlon wrote:

Uint32 video_flags;
.
.
.
/* Setup video /
video_flags=SDL_HWSURFACE|SDL_DOUBLEBUF;
SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, video_flags);
.
.
/
Switch to fullscreen /
video_flags|=SDL_FULLSCREEN;
SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, video_flags);
.
.
/
Switch to windowed mode */
video_flags&=~SDL_FULLSCREEN;
SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, video_flags);
.
.

it seems that under gtk, that code doesnt work if I have SDL over a
gtkwidget

My code:

/*close the previus screen */

SDL_QuitSubSystem ( SDL_INIT_VIDEO );

unsetenv (“SDL_WINDOWID”);

if ( SDL_Init ( SDL_INIT_VIDEO ) < 0)
{
	DK_ERROR ("Unable to init SDL: %s", SDL_GetError() );
	return (FALSE);
}

if ( SDL_VideoModeOK (screen->width, screen->height, 32,

SDL_FULLSCREEN) )
{
fullscreen = SDL_SetVideoMode ( screen->width, screen->height, 32,
SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN);
if (!fullscreen)
{
DK_ERROR (“Unable to set the fullscreen: %s”, SDL_GetError() );
return (FALSE);
}
}
else
{
DK_ERROR (“video mode is not supported”);
return (FALSE);
}

I need to close the window, unset the enviroment, and restart the
videosystem
And I dont preserve the old bitmap contents, by the way…

Also, when I return back to gtk mode (closing the video with
SDL_QuitSubSystem ( SDL_INIT_VIDEO ) ) SDL events crash the program (I
see it under gdb with ‘bt’)

Any suggestion?–
signed
derethor of centolos