Black screen on old linux distributions

Hello,

While trying to build a LSB5.0 compliant* version of SDL2 for my game, I
found that on old linux distributions, SDL2 library do not crash and the
game run but the screen stays black under X11.

Example with i686 arch:

  • CentOS/RHEL 4
  • Slackware 12
  • Mandriva 2006
  • Ubuntu 5.10

Everything works fine in Ubuntu 10.04 and above.

You will tell me that I am crazy to test that, but there is nothing that
forbids it :wink:

I haven’t found anything in the wiki that says “minimum X.org version is
x.y”

Furthermore SDL2 does compile on CentOS 4 so there is something in X11
initialisation that may have changed over time.

What can I do to debug this problem ?

Regards,
Matt

*http://ispras.linuxbase.org/index.php/About_Linux_Application_Checker

What can I do to debug this problem ?

Is it fullscreen that’s broken, by any chance?

Failing that: is it the renderer API that isn’t working? I bet it’s a GL 2.0 issue.

–ryan.

Le 22/02/2016 03:07, Ryan C. Gordon a ?crit :

What can I do to debug this problem ?

Is it fullscreen that’s broken, by any chance?

Failing that: is it the renderer API that isn’t working? I bet it’s a GL 2.0 issue.

–ryan.

It fails even in windowed mode (but then the window is white).

The 3 flags below trigger the “black screen” bug on CentOS 4.

  1. SDL_RENDERER_ACCELERATED in SDL_CreateRenderer()
  2. SDL_WINDOW_FULLSCREEN_DESKTOP in SDL_CreateWindow()
  3. SDL_WINDOW_OPENGL in SDL_CreateWindow()

It seems that fullscreen mode may not work in CentOS 4.

My game now runs normally in windowed mode by changing this line in my
code :
SDL_CreateRenderer(window, -1 ,SDL_RENDERER_ACCELERATED);
with
SDL_CreateRenderer(window, -1, 0);

How can I debug fullscreen mode ?

Regards,
Matt

Judging by what you just did, Ryan’s suggestion is likely correct that
you’re not being backed by hardware. SDL_RENDERER_ACCELERATED attempts to
use hardware rendering instead of software (ie back onto OpenGL or DirectX).

Do you have your graphics driver installed?On Mon, Feb 22, 2016 at 4:03 PM, Matt <matt.59491 at gmail.com> wrote:

Le 22/02/2016 03:07, Ryan C. Gordon a ?crit :

What can I do to debug this problem ?

Is it fullscreen that’s broken, by any chance?

Failing that: is it the renderer API that isn’t working? I bet it’s a GL
2.0 issue.

–ryan.

It fails even in windowed mode (but then the window is white).

The 3 flags below trigger the “black screen” bug on CentOS 4.

  1. SDL_RENDERER_ACCELERATED in SDL_CreateRenderer()
  2. SDL_WINDOW_FULLSCREEN_DESKTOP in SDL_CreateWindow()
  3. SDL_WINDOW_OPENGL in SDL_CreateWindow()

It seems that fullscreen mode may not work in CentOS 4.

My game now runs normally in windowed mode by changing this line in my
code :
SDL_CreateRenderer(window, -1 ,SDL_RENDERER_ACCELERATED);
with
SDL_CreateRenderer(window, -1, 0);

How can I debug fullscreen mode ?

Regards,
Matt


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

What can I do to debug this problem ?

Is it fullscreen that’s broken, by any chance?

Failing that: is it the renderer API that isn’t working? I bet it’s a
GL 2.0 issue.

–ryan.

It fails even in windowed mode (but then the window is white).

The 3 flags below trigger the “black screen” bug on CentOS 4.

  1. SDL_RENDERER_ACCELERATED in SDL_CreateRenderer()
  2. SDL_WINDOW_FULLSCREEN_DESKTOP in SDL_CreateWindow()
  3. SDL_WINDOW_OPENGL in SDL_CreateWindow()

It seems that fullscreen mode does not work in CentOS 4.

The problem occurs with both ‘software’ and ‘opengl’ renderers.

With SDL 1.2.15 compiled from source:

  • The X11_VIDMODE code works correctly for switching to fullscreen
  • The X11_XRANDR code works correctly as well

With SDL 2.0.4 compiled from source:

  • The X11_BeginWindowFullScreenLegacy() function does not work.
  • XRandr is not supported because minimum required version is 1.3
    whereas in SDL 1.2 minimum version is 1.0

The code below will trigger the BeginWindowFullScreenLegacy() function 3
times in a row but I can’t explain why.

window = SDL_CreateWindow(TITLE, 0, 0, 1024, 768, SDL_WINDOW_FULLSCREEN);
render = SDL_CreateRenderer(window,-1, 0);
texture = SDL_CreateTexture(render, SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_STREAMING, 1024, 768);
SDL_ShowCursor(SDL_DISABLE);

The X11 legacy mode in SDL2 may not be working as expected with Xorg
6.8.2. If I can help to debug the issue…

Regards,
Matt