I have a project that runs almost fine on android using SDL 2.0.0. I decided to switch to current 2.0.3 release to fix some problems. But I got new:
On 2.0.3 glEnable(GL_COLOR_MATERIAL) and glEnable(GL_TEXTURE_2D) resulting with glGetError 1280 (GL_INVALID_ENUM). On 2.0.0 same code working correctly.
What should I do now? Is there a way to investigate a problem? Where to should I take a look now?
Which OpenGL ES version are you specifying with SDL_GL_SetAttribute before creating the window/context? Those enums are only valid in GLES 1.1, and I believe SDL defaults to GLES 2 on Android if you don?t tell it otherwise.On Jul 9, 2014, at 3:26 PM, D216 wrote:
Hello!
I have a project that runs almost fine on android using SDL 2.0.0. I decided to switch to current 2.0.3 release to fix some problems. But I got new:
On 2.0.3 glEnable(GL_COLOR_MATERIAL) and glEnable(GL_TEXTURE_2D) resulting with glGetError 1280 (GL_INVALID_ENUM). On 2.0.0 same code working correctly.
What should I do now? Is there a way to investigate a problem? Where to should I take a look now?
Looking at your code, you are not selecting the OpenGL ES version you want,
so SDL selects the default for the platform. I honestly don’t recall if
this default changed from 2.0.0 to 2.0.3, but it looks like this could be
the case.
If you want to use GL ES 1, you need to
set SDL_GL_CONTEXT_MAJOR_VERSION, SDL_GL_CONTEXT_MINOR_VERSION
and SDL_GL_CONTEXT_PROFILE_MASK (See: https://wiki.libsdl.org/SDL_GL_SetAttribute)
2014-07-09 15:28 GMT-03:00 Alex Szpakowski :> Which OpenGL ES version are you specifying with SDL_GL_SetAttribute before
creating the window/context? Those enums are only valid in GLES 1.1, and I
believe SDL defaults to GLES 2 on Android if you don?t tell it otherwise.
On Jul 9, 2014, at 3:26 PM, D216 wrote:
Hello!
I have a project that runs almost fine on android using SDL 2.0.0. I
decided to switch to current 2.0.3 release to fix some problems. But I got
new:
On 2.0.3 glEnable(GL_COLOR_MATERIAL) and glEnable(GL_TEXTURE_2D) resulting
with glGetError 1280 (GL_INVALID_ENUM). On 2.0.0 same code working
correctly.
What should I do now? Is there a way to investigate a problem? Where to
should I take a look now?
Oh, thank You very much, guys! Your answers are absolutely correct. I just added two strings to set proper gl context version and it started working. Thanks alot!
After confirmation of solution I went deeper to find out a reason of my problem. I believe the problem is in SDL_video.c file, function SDL_VideoInit.
There is a piece of code, that in 2.0.0 looks like: