SDK: first call to glEnableClientState(GL_TEXTURE_COORD_ARRAY) gives bogus error

The first call to [pre]glEnableClientState(GL_TEXTURE_COORD_ARRAY)[/pre] after the OpenGL ES 1 emulator starts running raises a bogus GL_INVALID_ENUM error. Subsequent calls will not raise the error.

This is in version 2017 R1. This bug does not appear in previous versions.

The program es1loadtests at https://github.com/msc-/KTX/tree/vkloadtests shows the problem. Clone the repo; pick your flavor of Visual Studio project in build/msvs; build the solution and run es1loadtests.

The first set of tests draw a quad using the OES_draw_texture extension. Left click to advance tests. After a few clicks you’ll come tests that draw a textured cube. This is where the error happens.

The GL_INVALID_ENUM error is raised at line 157 in tests/loadtests/glloadtests/gles1/sample_02_textured.c,
the first, and only the first, time a cube test is run. All the cube tests use this same code.

In debug mode the uncollected error triggers the later assert at line 211, in atRun_02_cube() so no subsequent attempt is possible.

In release mode an error message box is raised during load of the test after the one that actually raised the error. After dismissing this message box, clicking the left mouse will advance you to the following test which also draws the cube. This time the same code will work fine. If you keep clicking left mouse you will eventually cycle back to the first test. The second time you can cycle through all the tests without encountering this error.

Hi, Mark
Do you use OpenGL ES context 1.0 ? for OpenGL ES 2.0/3.x the calling glEnableClientState will generate GL_INVALID_ENUM error.

OpenGL ES 1.x is very old API, try to use OpenGL ES 2.0/3x or Vulkan.

Yes I am using OpenGL ES 1.0, actually 1.1.

It is a test program for testing that the OpenGL ES 1.x version of my KTX loader library works properly so I cannot change it to 2.0/3.x. There is a 2.0/3.x version as well.