Screen blanks during SetInit

Hello all,

When I call SDL_Init(SDL_INIT_VIDEO), my screen momentarily blanks. I’ve tried
googling, but all I get are hits relating to image flickering. That’s not
what is happening. When I call SDL_Init(), my LCD screen blanks, then comes
back. Other than that, everything seems to be working.

I don’t think this is an SDL bug, but I it only happens with apps that use SDL
or when I use SDL in my apps.

Has this happened to anyone on the list? If so, how did you resolve the issue?

The system I’m developing on is:

openSUSE 10.2 32-bit
Dell Dimension E521 woth Dell 19" LCD 1907FP
AMD Athlon 64 X2 4200+ with 1GB RAM
ATI Radeon X1300 Pro 256MB PCI-Express with ATI Driver 8.32.5

Thanks,

Alvin

openSUSE 10.2 32-bit
Dell Dimension E521 woth Dell 19" LCD 1907FP
AMD Athlon 64 X2 4200+ with 1GB RAM
ATI Radeon X1300 Pro 256MB PCI-Express with ATI Driver 8.32.5

Set the SDL_VIDEODRIVER environment variable, just to make sure it’s not
trying to use fbcon:

export SDL_VIDEODRIVER=x11
./my-sdl-program

If that stops the flickering, then we’ll know why. If it doesn’t start
at all, your SDL was probably built without X11 support, which is why
it’s going to the fbcon driver.

SDL_Init() shouldn’t do anything to the display on the X11 target
(SDL_SetVideoMode() is, of course, a different story).

–ryan.

That didn’t make a difference. I stepped through the video initialisation
using gdb (from within KDevelop). The video blanked when I executed the
SDL_Init() line. That’s why I think it’s SDL_Init. I also think my hardware
is having a role in this issue as well. I had a hard time getting the ATI
driver to work (in the end I had to upgrade ALSA but that’s another story).
On my another machine with an Intel graphics chipset (i865G or something like
that), this issue doesn’t occur.

Also, I forgot to mention in the original post, but I’m using the SDL library
provided by the openSUSE 10.2 repos: version 1.2.11-22

Where I was experiencing excessive video blanking was when the window was
being resized. At this point I should also mention that the SDL surface is
embedded into a FLTK app using the SDL_WINDOWID environment variable. When
the app was being resized, the SDL_Surface would be recreated.

My original resize code reinitialised the SDL video by calling SDL_Quit()
followed by SDL_Init(). Then SDL_SetVideoMode() would be called using the new
surface dimensions.

I have just reworked the function to not reinitialise the SDL video system
during a resize. Now, SDL_Init is called on startup and the SDL_Quit() and
SDL_Init() combo when the SDL_Surface is being docked or undocked from the
FLTK app. Now the video blanking is greatly reduced to only these three
occasions. This is ok for me.

If this is the first time you or others have heard of this issue, then I would
say the problem is with my system, probably the ATI driver. If there is
anything else I could try, just let me know.

Thanks,
AlvinOn Tuesday 15 May 2007 19:19:56 Ryan C. Gordon wrote:

openSUSE 10.2 32-bit
Dell Dimension E521 woth Dell 19" LCD 1907FP
AMD Athlon 64 X2 4200+ with 1GB RAM
ATI Radeon X1300 Pro 256MB PCI-Express with ATI Driver 8.32.5

Set the SDL_VIDEODRIVER environment variable, just to make sure it’s not
trying to use fbcon:

export SDL_VIDEODRIVER=x11
./my-sdl-program

If that stops the flickering, then we’ll know why. If it doesn’t start
at all, your SDL was probably built without X11 support, which is why
it’s going to the fbcon driver.

SDL_Init() shouldn’t do anything to the display on the X11 target
(SDL_SetVideoMode() is, of course, a different story).

–ryan.

Is sdl_net enough for a game that supports max 10 user(on the lan or
over the net)? Or should I try another api?which?

SDL_net is basically a portable wrapper for low level TCP and UDP
communication, so it will probably do the trick in most cases where
the native APIs will.

However, it may not be very easy to use effectively together with the
SDL API. You might want to try adding NET2 for a nice, event driven
API:
http://gameprogrammer.com/net2/net2-0.html

If you want a higher level solution, there are a bunch of them out
there, but most of them seem to be proprietary (though some are “free
for non-commercial use”) or bound to some other media API than SDL.
You might be able find something here:
http://libsdl.org/libraries.php

//David Olofson - Programmer, Composer, Open Source Advocate

.------- http://olofson.net - Games, SDL examples -------.
| http://zeespace.net - 2.5D rendering engine |
| http://audiality.org - Music/audio engine |
| http://eel.olofson.net - Real time scripting |
’-- http://www.reologica.se - Rheology instrumentation --'On Wednesday 16 May 2007, engin wrote:

Is sdl_net enough for a game that supports max 10 user(on the lan
or over the net)? Or should I try another api?which?