Wierd shifted colors and unsatisfactory GL_Context

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Wierd shifted colors and unsatisfactory GL_Context

Edition Chamäleon
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.

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wierd shifted colors and unsatisfactory GL_Context

Edition Chamäleon
Does really no one have any hints for me on that issue? Sad

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wierd shifted colors and unsatisfactory GL_Context

EternalLands
In reply to this post by Edition Chamäleon
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.

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wierd shifted colors and unsatisfactory GL_Context

Sylvain Becker
In reply to this post by Edition Chamäleon
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 <[hidden email]> wrote:
Does really no one have any hints for me on that issue? Sad

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org




--
Sylvain Becker

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wierd shifted colors and unsatisfactory GL_Context

Edition Chamäleon
In reply to this post by Edition Chamäleon
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

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wierd shifted colors and unsatisfactory GL_Context

Edition Chamäleon
In reply to this post by Edition Chamäleon
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

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Wierd shifted colors and unsatisfactory GL_Context

Edition Chamäleon
In reply to this post by Edition Chamäleon
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

_______________________________________________
SDL mailing list
[hidden email]
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
Loading...