Fullscreen?

Hello

I’m quite new to sdl and have a simple question.
What else than specifying SDL_Fullscreen in flags in a SDL_SetVideoMode call
do I have to do to get fullscreen? Is it depending on other things like X?
plaympeg which uses the smpeg lib plays fine in fullscreen but that is the
only sdl app that i’ve been able to run in fullscreen. The small bmp-example
does everything fine except that it doesnt use fullscreen.

Thanks in advance
Mattias Blomqvist

Nothing else is needed. I do it like this, and it works (SDL-1.1.1,
XFree3.3.3.1 IIRC):

screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);

Try to remove any other stuff and keep it simple until it works. Use a
videomode that you are sure you have (like the 640x480x16bit).

All the best,
robOn Wed, Mar 15, 2000 at 12:42:33PM +0200, Mattias.Blomqvist at nokia.com wrote:

Hello

I’m quite new to sdl and have a simple question.
What else than specifying SDL_Fullscreen in flags in a SDL_SetVideoMode call
do I have to do to get fullscreen?

I’m quite new to sdl and have a simple question.
What else than specifying SDL_Fullscreen in flags in a
SDL_SetVideoMode call
do I have to do to get fullscreen?

Nothing else is needed. I do it like this, and it works (SDL-1.1.1,
XFree3.3.3.1 IIRC):

screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);

Try to remove any other stuff and keep it simple until it works. Use a
videomode that you are sure you have (like the 640x480x16bit).

Thanks for your answer
The code below displays a 640x480 window. I have tried depth-values of
0,8,15,16,24 and 32. SDL is version 1.1.0 and I think XFree86 is version
3.3.6 (how do I check?). I currently run X at 1280x1024x24 and use KDE as
wm. Does the type of X-acceleration matter? I use the mach64 server.

Any help i greatly apreciated
Mattias Blomqvist

#include <SDL/SDL.h>

int main(int argc, char *argv[])
{
SDL_Surface *screen;
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) {
exit(1);
}
screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);
if ( screen == NULL ) {
exit(1);
}
sleep(5);
SDL_Quit();
return 0;
}

Mattias.Blomqvist at nokia.com wrote:

Thanks for your answer
The code below displays a 640x480 window. I have tried depth-values of
0,8,15,16,24 and 32. SDL is version 1.1.0 and I think XFree86 is version
3.3.6 (how do I check?). I currently run X at 1280x1024x24 and use KDE as
wm. Does the type of X-acceleration matter? I use the mach64 server.

You also need to have any video modes you want to use defined in the
XF86Config – so you would need a Modes line something like:

Section "Screen"
Driver "accel"
Device "3D Rage Pro AGP 1X/2X"
Monitor "MEI11267"
Subsection "Display"
Depth 16
Modes “1280x1024” “1024x768” “800x600” “640x480”
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ViewPort 0 0
EndSubsection
Endsection

Obviously, you don’t want the ^s in there =) (If you don’t have the
resolutions defined, X can’t switch to them, so SDL can’t switch to
them…)–
rot13 for e-mail: @Ex-Makron

KDE has an information program (buried in one of those menus) that
will tell you the version of X you are running. To use a mode
fullscreen (as opposed to running with a black box around the display)
you have to have the corresponding modeline in your xf86config file,
then all you have to do is pass the fullscreen flag to
SDL_SetVideoMode. It should work with the Mach64 server too, I used
to use it (before I got my Voodoo 3) with my ATI 3D Rage II card and
have used fullscreen in 640x480 and 800x600 (that’s where my monitor
stops).

Phoenix Kokido
members.xoom.com/kokido
@Wes_Poole

Mattias.Blomqvist at nokia.com wrote:> > > I’m quite new to sdl and have a simple question.

What else than specifying SDL_Fullscreen in flags in a
SDL_SetVideoMode call
do I have to do to get fullscreen?

Nothing else is needed. I do it like this, and it works (SDL-1.1.1,
XFree3.3.3.1 IIRC):

screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);

Try to remove any other stuff and keep it simple until it works. Use a
videomode that you are sure you have (like the 640x480x16bit).

Thanks for your answer
The code below displays a 640x480 window. I have tried depth-values of
0,8,15,16,24 and 32. SDL is version 1.1.0 and I think XFree86 is version
3.3.6 (how do I check?). I currently run X at 1280x1024x24 and use KDE as
wm. Does the type of X-acceleration matter? I use the mach64 server.

Any help i greatly apreciated
Mattias Blomqvist

#include <SDL/SDL.h>

int main(int argc, char *argv[])
{
SDL_Surface *screen;
if (SDL_Init(SDL_INIT_VIDEO) < 0 ) {
exit(1);
}
screen = SDL_SetVideoMode(640, 480, 16, SDL_FULLSCREEN);
if ( screen == NULL ) {
exit(1);
}
sleep(5);
SDL_Quit();
return 0;
}

PS: isn’t it possible for SDL to change ‘physically’ the color depth ?
My game uses 8 bit color and it is very fast with X default colordepth
set to 8, but rather slow under 32 bit emulation.

Not until DGA 2.0. :slight_smile:

The latest CVS version of SDL can choose the closest visual available, so
if your X server supports multiple visuals (multiple depths) than SDL will
get as close as possible to your desired depth.

See ya!
-Sam Lantinga (slouken at devolution.com)

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

Hi there,
I know there’s a lot of concern over whether or not it’s legally
safe to TrueType font rendering code directly in a SDL application. I
mentioned last week that the old Borland Graphics Interface CHR stroke
file format just might be a plausible alternative. There are a number of
CHR fonts out there, plus a DOS/Windows shareware utility that can convert
TrueType fonts to CHR fonts.

I took the initiative to decipher the format and I've written a

little interpreter that dumps out to the console all of the drawing
instructions for individual characters. You can find the font.c program
and a whole mess of sample CHR fonts at:
http://tmmm.simplenet.com/font/
All that’s necessary is to “connect the dots”.

Hope this helps...
    -The Mighty Mike Master
    http://tmmm.simplenet.com

The code below displays a 640x480 window. I have tried
depth-values of
0,8,15,16,24 and 32. SDL is version 1.1.0 and I think
XFree86 is version
3.3.6 (how do I check?). I currently run X at 1280x1024x24
and use KDE as
wm. Does the type of X-acceleration matter? I use the mach64 server.

You also need to have any video modes you want to use defined in the
XF86Config – so you would need a Modes line something like:

Section "Screen"
Driver "accel"
Device "3D Rage Pro AGP 1X/2X"
Monitor "MEI11267"
Subsection "Display"
Depth 16
Modes “1280x1024” “1024x768” “800x600” “640x480”
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ViewPort 0 0
EndSubsection
Endsection

Obviously, you don’t want the ^s in there =) (If you don’t have the
resolutions defined, X can’t switch to them, so SDL can’t switch to
them…)

Thanks everyone for your answers.
Unfortunately the modelines were allready in my XF86config file so it didnt
help much. Any other ideas?

Mattias Blomqvist

The Mighty Mike Master wrote:

All that’s necessary is to “connect the dots”.

Yes, but with CHR fonts if you only “connect the dots”,
when you enlarge the char size, the thickness of lines
doesn’t change. With large sizes, this can be a problem.

Enzo.

The Mighty Mike Master wrote:

All that’s necessary is to “connect the dots”.

Yes, but with CHR fonts if you only “connect the dots”,
when you enlarge the char size, the thickness of lines
doesn’t change. With large sizes, this can be a problem.
This is because CHR fonts are vectors???
I think I remember vector graphics on the old Apple 2’s… :slight_smile:

DaveOn Wed, 15 Mar 2000, Enzo wrote:

Enzo.

> > > All that's necessary is to "connect the dots". > > > > Yes, but with CHR fonts if you only "connect the dots", > > when you enlarge the char size, the thickness of lines > > doesn't change. With large sizes, this can be a problem. > This is because CHR fonts are vectors??? > I think I remember vector graphics on the old Apple 2's... :)

I think what they meant was that with CHR fonts, the inside of
the character aren’t filled in so when you have a large character,
it looks hollow. The fill probably wasn’t done because it would
be computationally too intensive on the computers back then.

You should take a look at /etx/X11/XF86Config. Is the mode 640x480
defined in the section screen/mach64 ?

Bye
Nimrod.

PS: isn’t it possible for SDL to change ‘physically’ the color depth ?
My game uses 8 bit color and it is very fast with X default colordepth
set to 8, but rather slow under 32 bit emulation.