Discussion:
[SDL] Wierd shifted colors and unsatisfactory GL_Context
Edition Chamäleon
2016-11-25 15:33:56 UTC
Permalink
Hello everybody,

I have problems setting SDL_GL_SetAttribute. I have written an app for Android, which runs well on almost all devices ( startscreen see figure 1). On some devices I have the problem that the colors are shifted (see figure 2).
It turned out that in the GL context, the pixel format is RGB444 instead of the desired RGB888. So I have despite my SDL_GL_SetAttribute default RGB888 received only RGB444. As far as logical, the device obviously can’t give more !?. (Samsung SIII GT-I9300 - should be able for RGB888 )

figure1:
[Image: Loading Image... ]

figure 2:
[Image: Loading Image... ]

Now comes the wierd part:
If I delete SDL_Window, SDL_Renderer and GL_Context (SDL_DestroyRenderer, SDL_GL_DeleteContext, SDL_DestroyWindow) and simply recreate it directly in the same thread ( order: SetSDLAttributes, SDL_CreateWindow, SDL_GL_CreateContext, SDL_CreateRenderer), I suddenly get a correct graphics output (picture 1) and SDL_GL_SetAttribute RGB888.

What did I do wrong? Something with the order of the calls?

I would really like to solve this a little more elegant than creating an SDL_Window, a GL_Context and a SDL_Renderer, then destroy it and recreate it right away. Especially because there are other end devices that seem to have a problem and crash.
Edition Chamäleon
2016-12-03 22:36:25 UTC
Permalink
Does really no one have any hints for me on that issue? :(
Sylvain Becker
2016-12-05 08:30:57 UTC
Permalink
Hello,

I think you hit this issue: https://bugzilla.libsdl.org/show_bug.cgi?id=2291
On the Samsung s3, some egl config behave strangely.

Depending on the "SDL_GL_SetAttribute" that you set, you can get one of
those broken config.

Before modifying your code, you could also try to set
"SDL_RENDERER_PRESENTVSYNC" if you use the renderer or manually (eg
eglSwapInterval).
I saw some issue on the S6 with this.

Cheers,
Sylvain
Does really no one have any hints for me on that issue? [image: Sad]
_______________________________________________
SDL mailing list
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Sylvain Becker
EternalLands
2016-12-03 23:50:15 UTC
Permalink
How does your code look like? How about alpha? Did you try to change the stencil or depth to fewer bits?
Even in a RGB444 mode, the colors shouldn't look like that. I mean, no red instead of green.
Edition Chamäleon
2016-12-06 22:56:31 UTC
Permalink
Hi Sylvan,

thanks for this hint. The Red-Screen-Issue on bugzilla is exactly my problem with S3. There are some traces in the 108 posts there I've to go after now. I'll post again, when I've done.

The SDL_RENDERER_PRESENTVSYNC is set in my app by the way.

Thx, Michael
Edition Chamäleon
2016-12-06 22:56:51 UTC
Permalink
Hi Sylvan,

thanks for this hint. The Red-Screen-Issue on bugzilla is exactly my problem with S3. There are some traces in the 108 posts there I've to go after now. I'll post again, when I've done.

The SDL_RENDERER_PRESENTVSYNC is set in my app by the way.

Thx, Michael
Edition Chamäleon
2016-12-06 22:58:22 UTC
Permalink
Hi Sylvan,

thanks for this hint. The Red-Screen-Issue on bugzilla is exactly my problem with S3. There are some traces in the 108 posts there I've to go after now. I'll post again, when I've done.

The SDL_RENDERER_PRESENTVSYNC is set in my app by the way.

Thx, Michael
Loading...