ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
694 stars 159 forks source link

GL_POINT_SIZE_MIN and GL_POINT_SIZE_MAX don't exist in OpenGL ES #386

Closed major-mayer closed 2 years ago

major-mayer commented 2 years ago

I just stumbled across this issue while trying to call this function glGetFloatv(GL_POINT_SIZE_RANGE, pointSizeRange);. GL_POINT_SIZE_RANGE doesn't exist in OpenGL ES, but the way it's mapped is also wrong:

case GL_POINT_SIZE_RANGE:
            gles_glGetFloatv(GL_POINT_SIZE_MIN, params); // Those enums don't exist in opengl es / webgl
            gles_glGetFloatv(GL_POINT_SIZE_MAX, params+1);
            break;

getter.c line 890

Those constants values don't exist in OpenGL ES according to this page: https://docs.gl/es2/glGet

As a workaround I now query for GL_ALIASED_POINT_SIZE_RANGE:

case GL_POINT_SIZE_RANGE:
            gles_glGetFloatv(GL_ALIASED_POINT_SIZE_RANGE, params);
            break; 

At least it doesn't create an error anymore and i guess it does somwhat the same

ptitSeb commented 2 years ago

Yes, you are right. I have fixed the getter for this, thanks.

major-mayer commented 2 years ago

Glad that I could help to find this issue. Apart from that, your library seems to be doing a fantastic job :)

ptitSeb commented 2 years ago

Thank you!

Out of curiosity, on what kind of project are you trying it?

major-mayer commented 2 years ago

I am using it to port a CNC machine simulation library to Webassembly that also renders meshes. This library uses old OpenGL 1.5 which Emscripten only supports very limited, so i tried using Gl4es as translation layer between OpenGL ES2 and OpenGL 1.5.

Unfortunately, this project is not open source, so I cannot link it here. But if I find bugs or got suggestions for other improvements, I will post it here.

ptitSeb commented 2 years ago

Good. thank you for the informations :)

it's always nice to see our stuffs actualy used!