Xscreensaver, SDL_WINDOWID

Has anyone been able to get SDL programs to work with
xscreensaver recently? I’m using Red Hat Linux 7.2
with the GNOME desktop. The SDL_WINDOWID trick does
not seem to work.

If I run the following script manually, I can get the
"test" SDL program to display on the root window, as long
as I kill nautilus (this is the same behavior as other
xscreensaver programs):

$ cat TEST
#!/bin/sh
export
SDL_WINDOWID=xwininfo -root|grep "id:"|sed 's/^.*id: //'|sed 's/ (.*$//'
/some/absolute/path/test

$ ./TEST

But if I launch this TEST script from xscreensaver, I get
a black screen, even though xscreensaver launches the "test"
program in the background.

I’ve tried making the SDL window the same size and depth
as the root window, etc., with the same results. Any help
would be appreciated.

– Paul

I’m still unable to display any SDL program under xscreensaver.
One difference I noticed between X11 / GLX xscreensaver programs
and SDL programs is the visuals.

My root window is: 1024x768, 24-bit, TrueColor
My SDL test program is: 1024x768, 24-bit, DirectColor

Is there any way to force the visuals on the SDL program to
TrueColor? I have a Nvidia card running the Nvidia GLX module.

Thanks much in advance.

– Paul>

Has anyone been able to get SDL programs to work with
xscreensaver recently? I’m using Red Hat Linux 7.2
with the GNOME desktop. The SDL_WINDOWID trick does
not seem to work.

If I run the following script manually, I can get the
"test" SDL program to display on the root window, as long
as I kill nautilus (this is the same behavior as other
xscreensaver programs):

$ cat TEST
#!/bin/sh
export
SDL_WINDOWID=xwininfo -root|grep "id:"|sed 's/^.*id: //'|sed 's/ (.*$//'
/some/absolute/path/test

$ ./TEST

But if I launch this TEST script from xscreensaver, I get
a black screen, even though xscreensaver launches the "test"
program in the background.

I’ve tried making the SDL window the same size and depth
as the root window, etc., with the same results. Any help
would be appreciated.

– Paul


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I’m still unable to display any SDL program under xscreensaver.
One difference I noticed between X11 / GLX xscreensaver programs
and SDL programs is the visuals.

My root window is: 1024x768, 24-bit, TrueColor
My SDL test program is: 1024x768, 24-bit, DirectColor

Is there any way to force the visuals on the SDL program to
TrueColor? I have a Nvidia card running the Nvidia GLX module.

Yes, set the SDL_VIDEO_X11_NODIRECTCOLOR environment variable to “1”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sorry if this sounds silly, but what exactly does NODIRECTCOLOR do? Or
rather what effect would it have on your program under X11?On Sun, Apr 21, 2002 at 09:30:40PM -0700, Sam Lantinga wrote:

I’m still unable to display any SDL program under xscreensaver.
One difference I noticed between X11 / GLX xscreensaver programs
and SDL programs is the visuals.

My root window is: 1024x768, 24-bit, TrueColor
My SDL test program is: 1024x768, 24-bit, DirectColor

Is there any way to force the visuals on the SDL program to
TrueColor? I have a Nvidia card running the Nvidia GLX module.

Yes, set the SDL_VIDEO_X11_NODIRECTCOLOR environment variable to “1”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

My root window is: 1024x768, 24-bit, TrueColor
My SDL test program is: 1024x768, 24-bit, DirectColor

Is there any way to force the visuals on the SDL program to
TrueColor? I have a Nvidia card running the Nvidia GLX module.

Yes, set the SDL_VIDEO_X11_NODIRECTCOLOR environment variable to “1”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sorry if this sounds silly, but what exactly does NODIRECTCOLOR do? Or
rather what effect would it have on your program under X11?

It prevents SDL from using DirectColor visuals, which disabled gamma ramps.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Is there any way to force the visuals on the SDL program to
TrueColor? I have a Nvidia card running the Nvidia GLX module.

Yes, set the SDL_VIDEO_X11_NODIRECTCOLOR environment variable to “1”

Thanks Sam. I tried this, but SDL programs still won’t display
under xscreensaver. A kind soul told me why it doesn’t work,
but I don’t have a solution yet. xscreensaver gives you a different
virtual root window each time an SDL program is run; it would be
different from the real root window. Apparently a wrapper like vroot.h
(from the xscreensaver source code) needs to be written.

– Paul

Sam Lantinga wrote:

My root window is: 1024x768, 24-bit, TrueColor
My SDL test program is: 1024x768, 24-bit, DirectColor

Is there any way to force the visuals on the SDL program to
TrueColor? I have a Nvidia card running the Nvidia GLX module.

Yes, set the SDL_VIDEO_X11_NODIRECTCOLOR environment variable to “1”

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

Sorry if this sounds silly, but what exactly does NODIRECTCOLOR do? Or
rather what effect would it have on your program under X11?

It prevents SDL from using DirectColor visuals, which disabled gamma ramps.

IIRC, under X11 TrueColor has gamma ramps and DirectColor does not. That
is why TrueColor is called TrueColor, it has gamma ramps that make it
possible to actually produce a true color.

		Bob P.> 

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


±-----------------------------------------+

  • Bob Pendleton, an experienced C/C++/Java +
  • UNIX/Linux programmer, researcher, and +
  • system architect, is seeking full time, +
  • consulting, or contract employment. +
  • Resume: http://www.jump.net/~bobp +
  • Email: @Bob_Pendleton +
    ±-----------------------------------------+