Wierd shifted colors and unsatisfactory GL_Context

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: http://editionchamaeleon.de/figures/2.jpg ]

figure 2:
[Image: http://editionchamaeleon.de/figures/1.jpg ]

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.

Does really no one have any hints for me on that issue? :frowning:

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.

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,
SylvainOn 3 December 2016 at 23:36, Edition Cham??leon wrote:

Does really no one have any hints for me on that issue? [image: Sad]


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


Sylvain Becker

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

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

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