Resolution switching with 3dfx cards

Hi!

I’m still working on the SDL version of Doom Legacy and it runs fine now
in SW and HW rendering. One problem remains which does not occur in the
native Linux version with GLX:

Legacy always starts in a 320x200 window and switches to the specified
resolution afterwards. With 3dfx cards under OpenGL this does not seem
to work, as the physical resolution always stays 512x384 and only the
lower left 512x384 rectangle of the complete frame is displayed. I do
the resolution switching with the following code:

if(NULL != vidSurface)
{
SDL_FreeSurface(vidSurface);
vidSurface = NULL;
}

if(isFullscreen)
{
surfaceFlags = SDL_OPENGL|SDL_FULLSCREEN;
}
else
{
surfaceFlags = SDL_OPENGL;
}

if((vidSurface = SDL_SetVideoMode(w, h, 16, surfaceFlags)) == NULL)

// 16 BPP
return false;

I do not want to completely shutdown and start up SDL, as this would
affect music and sound as well. Any suggestions?

Cheers,

/Rob

Hi!

I’m still working on the SDL version of Doom Legacy and it runs fine now
in SW and HW rendering. One problem remains which does not occur in the
native Linux version with GLX:

Legacy always starts in a 320x200 window and switches to the specified
resolution afterwards. With 3dfx cards under OpenGL this does not seem
to work, as the physical resolution always stays 512x384 and only the
lower left 512x384 rectangle of the complete frame is displayed.

This is a limitation of the 3dfx drivers, I believe. Try starting in
640x400 mode. ?

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

I do not want to completely shutdown and start up SDL, as this would
affect music and sound as well. Any suggestions?

SDL_QuitSubSystem() will solve that at least.

m.On Mon, Jul 03, 2000 at 10:43:34PM +0200, Robert Bduml wrote:


Programmer “Ha ha.” “Ha ha.” "What are you laughing at?"
Loki Software "Just the horror of being alive."
http://lokigames.com/~briareos/ - Tony Millionaire

interesant problem,

we have the same.

Sam, is there a clean way to change resolution in SDL ?
Is it possible to write a :
SDL_ReSetVideoMode(…) ?

Stephane> Hi!

I’m still working on the SDL version of Doom Legacy and it runs fine now
in SW and HW rendering. One problem remains which does not occur in the
native Linux version with GLX:

Legacy always starts in a 320x200 window and switches to the specified
resolution afterwards. With 3dfx cards under OpenGL this does not seem
to work, as the physical resolution always stays 512x384 and only the
lower left 512x384 rectangle of the complete frame is displayed. I do
the resolution switching with the following code:

if(NULL != vidSurface)
{

SDL_FreeSurface(vidSurface);
vidSurface = NULL;
}

if(isFullscreen)
{

surfaceFlags = SDL_OPENGL|SDL_FULLSCREEN;
}
else
{
surfaceFlags = SDL_OPENGL;
}

if((vidSurface = SDL_SetVideoMode(w, h, 16, surfaceFlags)) == NULL)

// 16 BPP
return false;

I do not want to completely shutdown and start up SDL, as this would
affect music and sound as well. Any suggestions?

Cheers,

/Rob

> I do not want to completely shutdown and start up SDL, as this would > affect music and sound as well. Any suggestions?

SDL_QuitSubSystem() will solve that at least.

m.

If I use SDL_QuitSubSystem() on Win32 with DirectX and only shut down the
video subsystem, doesn’t that affect the sound as well - I think I remember
some problems with DirectX, that’s why video and audio is initialized
simultaneously.

/Rob–
Sent through GMX FreeMail - http://www.gmx.net

If I use SDL_QuitSubSystem() on Win32 with DirectX and only shut down the
video subsystem, doesn’t that affect the sound as well - I think I
remember
some problems with DirectX, that’s why video and audio is initialized
simultaneously.

Uh, I should hope not. Games like Quake on Win32 routinely shutdown sound
and restart it independently of the video layer.

m.–
“Advocating a system based on consumption is the ultimate violence against
poor nations.”
-Masamune Shirow

If I use SDL_QuitSubSystem() on Win32 with DirectX and only shut down the
video subsystem, doesn’t that affect the sound as well - I think I
remember
some problems with DirectX, that’s why video and audio is initialized
simultaneously.

Uh, I should hope not. Games like Quake on Win32 routinely shutdown sound
and restart it independently of the video layer.

Unfortunately, DirectSound is tied to the window handle, so you can’t
de-initialize the video separately from the audio, I believe. There
might be a trick to working around this problem, but it would depend
on your situation.

See ya,
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Unfortunately, DirectSound is tied to the window handle, so you can’t
de-initialize the video separately from the audio, I believe. There

Ugh. Who thinks this stuff up?

/me shivers

m.–
“Advocating a system based on consumption is the ultimate violence against
poor nations.”
-Masamune Shirow

Michael K Vance wrote:

Unfortunately, DirectSound is tied to the window handle, so you can’t
de-initialize the video separately from the audio, I believe. There

Ugh. Who thinks this stuff up?

My understanding is that directx uses the window handle solely so it can
tell if your app has died, ie stopped processing messages, so that it
can relinquish control and free up resources if the app was in exclusive
(eg fullscreen) mode. Pretty evil, huh?

Ben.–
Ben Campbell (Antipodean Straggler)
Programmer, Creature Labs
ben.campbell at creaturelabs.com
www.creaturelabs.com

Sam Lantinga wrote in message
news:E139UlU-0001wa-00 at roboto.devolution.com

Unfortunately, DirectSound is tied to the window handle, so you can’t
de-initialize the video separately from the audio, I believe. There
might be a trick to working around this problem, but it would depend
on your situation.

Would it be possible to keep the window around and make it invisible while
the video subsystem isn’t initialized?–
Rainer Deyke (root at rainerdeyke.com)
Shareware action/role-playing games - http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor

Sam Lantinga wrote in message
news:E139UlU-0001wa-00 at roboto.devolution.com

Unfortunately, DirectSound is tied to the window handle, so you can’t
de-initialize the video separately from the audio, I believe. There
might be a trick to working around this problem, but it would depend
on your situation.

Would it be possible to keep the window around and make it invisible while
the video subsystem isn’t initialized?

Yes, although there currently isn’t any way to tell SDL to do that.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Only for the record:

I have incorporated SDL_QuitSubSystem(SDL_INIT_VIDEO),
SDL_InitSubsystem(SDL_INIT_VIDEO) upon switching of resolutions under Linux. Now the Voodoo
card switches to the correct physical resolution - once. The second time I want
to switch it crashes. This is a real pity, as the native Linux version can
switch between resolutions in SW and HW rendering. I do not know if that’s a
bug in Mesa, SDL or my code, but I think the workaround is to simply start
in 640x480, which is a decent resolution for Doom under OpenGL. And anyone
with a voodoo card simply should not change the resolution (in fact voodoo
cards are a problem anyway because they are not tied to the X-Server
resolutions).

Thanks for all your help :slight_smile:

Cheers,

/Rob–
Sent through GMX FreeMail - http://www.gmx.net

Is this in X4?On Wed, 5 Jul 2000, Robert [ISO-8859-1] B?uml wrote:

Only for the record:

I have incorporated SDL_QuitSubSystem(SDL_INIT_VIDEO),
SDL_InitSubsystem(SDL_INIT_VIDEO) upon switching of resolutions under Linux. Now the Voodoo
card switches to the correct physical resolution - once. The second time I want
to switch it crashes. This is a real pity, as the native Linux version can
switch between resolutions in SW and HW rendering. I do not know if that’s a
bug in Mesa, SDL or my code, but I think the workaround is to simply start
in 640x480, which is a decent resolution for Doom under OpenGL. And anyone
with a voodoo card simply should not change the resolution (in fact voodoo
cards are a problem anyway because they are not tied to the X-Server
resolutions).

Thanks for all your help :slight_smile:

Cheers,

/Rob


Sent through GMX FreeMail - http://www.gmx.net

Martin

Bother! said Pooh, as he chambered a round.

interesant problem,

we have the same.

Sam, is there a clean way to change resolution in SDL ?
Is it possible to write a :
SDL_ReSetVideoMode(…) ?

All you have to do is call SDL_SetVideoMode() a second time with the
new desired mode. It should work correctly, if it does not, it is a
bug.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Is this in X4?

No, it’s X3. But the problem seems to be glide for the Voodoo2 (or Mesa?)
which does not change correctly.–
Sent through GMX FreeMail - http://www.gmx.net

Robert B?uml <Robert.Baeuml at gmx.net> schrieb am 05 Jul 2000:

Only for the record:

I have incorporated SDL_QuitSubSystem(SDL_INIT_VIDEO),
SDL_InitSubsystem(SDL_INIT_VIDEO) upon switching of resolutions under Linux. Now the Voodoo
card switches to the correct physical resolution - once. The second time I want
to switch it crashes. This is a real pity, as the native Linux version can
switch between resolutions in SW and HW rendering. I do not know if that’s a
bug in Mesa, SDL or my code, but I think the workaround is to simply start
in 640x480, which is a decent resolution for Doom under OpenGL. And anyone
with a voodoo card simply should not change the resolution (in fact voodoo
cards are a problem anyway because they are not tied to the X-Server
resolutions).

After reading this thread I have incorporated SDL_InitSubSystem and
SDL_QuitSubSystem into GLtron (not yet in CVS, mail me if you want the
source). On my system (Voodoo 3 2000, XFree86-3.3.6, Mesa-3.2, Glide-2.60-16)
I get the following behaviour:

Switching resolution works. Many times. It doesn’t matter if SDL_FULLSCREEN is
set or not. There is a small memory leak, but that could be my texture
loading stuff (or Mesa).

Remarks:

  • modes < 640x480 are not hardware accelerated (Mesa X11 - 1.2 Mesa 3.2)

  • in these modes, the memory footprint of GLtron grows from 8 MB to ~80 MB

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.59)

After reading this thread I have incorporated SDL_InitSubSystem and
SDL_QuitSubSystem into GLtron

SDL_InitSubSystem and SDL_QuitSubSystem are not necessary to switch
video modes. All you have to do is call SDL_SetVideoMode() with the
new desired resolution, and SDL will clean up the old mode and set
the new video mode. You can even switch between GL and non-GL modes
in this way.

See ya!
-Sam Lantinga, Lead Programmer, Loki Entertainment Software

Sam Lantinga schrieb am 06 Jul 2000:

After reading this thread I have incorporated SDL_InitSubSystem and
SDL_QuitSubSystem into GLtron

SDL_InitSubSystem and SDL_QuitSubSystem are not necessary to switch
video modes. All you have to do is call SDL_SetVideoMode() with the
new desired resolution, and SDL will clean up the old mode and set
the new video mode. You can even switch between GL and non-GL modes
in this way.

Actually, that’s not correct. SDL_SetVideoMode() WILL NOT alter
the physical resolution on 3dfx boards (at least in GL mode).
If that’s a bug, so be it. But SDL_{Quit|Init}SubSystem works around this.

  • Andreas–
    Check out my 3D lightcycle game: http://www.gltron.org
    More than 60’000 Downloads of the latest version (0.59)