SDL Android opengl rendering issues

This might totally be my fault but I am trying to render a simple opengl
scene on a galaxy s3, things work perfectly fine on a note 4 but this s3 is
giving me some real issues.

First I had to remove all calls that used Vertex Array Objects to get rid
of calling unimplemented ES API

but this is just strange.

my includes

#include “SDL.h”
#include “SDL_opengles2.h”

SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_ES);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);

    SDL_GetDisplayMode(0, 0, &sdpm);
    i_width = sdpm.w;
    i_height = sdpm.h;

    window = SDL_CreateWindow(title, SDL_WINDOWPOS_CENTERED,

SDL_WINDOWPOS_CENTERED, i_width, i_height, SDL_WINDOW_OPENGL |
SDL_WINDOW_SHOWN);

this is all that I am calling in my render function

glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
SDL_GL_SwapWindow(window);

Doing that above code and rendering on one of my devices, the screen isn’t
red it’s a hot pink, like the old school texture atlas background color.

If I rotate the phone, for that split second when the screen is rotating I
can see the red background.

I am not sure what’s going on or how to debug this, any tips?

Try adding these lines just before creating the window and context:

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

(or 8, 8, 8, rather than 5, 6, 5.)

If that works, it sounds like you could be encountering this bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2291 https://bugzilla.libsdl.org/show_bug.cgi?id=2291> On Aug 23, 2015, at 9:23 AM, Owen Alanzo Hogarth wrote:

Doing that above code and rendering on one of my devices, the screen isn’t red it’s a hot pink, like the old school texture atlas background color.

If I rotate the phone, for that split second when the screen is rotating I can see the red background.

I am not sure what’s going on or how to debug this, any tips?


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

@Alex

Using 565 worked like a charm, I guess it is that bug. I have a
international galaxy s3.

Is there any way to detect this from within code? Is it safe just to always
use 565? What if I deploy an app, is this safe?On Sun, Aug 23, 2015 at 8:33 PM, Alex Szpakowski wrote:

Try adding these lines just before creating the window and context:

SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 6);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

(or 8, 8, 8, rather than 5, 6, 5.)

If that works, it sounds like you could be encountering this bug:
https://bugzilla.libsdl.org/show_bug.cgi?id=2291

On Aug 23, 2015, at 9:23 AM, Owen Alanzo Hogarth <@Owen_Alanzo_Hogarth> wrote:

Doing that above code and rendering on one of my devices, the screen isn’t
red it’s a hot pink, like the old school texture atlas background color.

If I rotate the phone, for that split second when the screen is rotating I
can see the red background.

I am not sure what’s going on or how to debug this, any tips?


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


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