Wierd shifted colors and unsatisfactory GL_Context
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 )
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.