The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Wierd shifted colors and unsatisfactory GL_Context
Edition Chamäleon


Joined: 03 Nov 2016
Posts: 16
Location: Düsseldorf, Germany
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:


figure 2:


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


Joined: 03 Nov 2016
Posts: 16
Location: Düsseldorf, Germany
Does really no one have any hints for me on that issue? Sad
EternalLands


Joined: 01 Dec 2016
Posts: 16
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.
Wierd shifted colors and unsatisfactory GL_Context
slvn


Joined: 06 Oct 2012
Posts: 88
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



























On 3 December 2016 at 23:36, Edition Chamäleon wrote:
Quote:
Does really no one have any hints for me on that issue?


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
Sylvain Becker
Edition Chamäleon


Joined: 03 Nov 2016
Posts: 16
Location: Düsseldorf, Germany
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


Joined: 03 Nov 2016
Posts: 16
Location: Düsseldorf, Germany
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


Joined: 03 Nov 2016
Posts: 16
Location: Düsseldorf, Germany
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