Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRIM: use GL_UNSIGNED_SHORT for glDrawElements instead of GL_UNSIGNED… #2617

Merged
merged 1 commit into from Nov 12, 2020

Conversation

@lmerckx
Copy link
Contributor

@lmerckx lmerckx commented Nov 11, 2020

When running with an OpenGL ES 2 library (not above), glDrawElements(GL_TRIANGLES,3 * face->_faceLength, GL_UNSIGNED_INT, 0) of drawEMIModelFace() (gfx_opengl_shaders.cpp) exits with error code GL_INVALID_ENUM.

Indeed, GLES v2 doesn't support GL_UNSIGNED_INT (only BYTE and SHORT).
See documentation here: http://docs.gl/es2/glDrawElements

This modification converts GL_UNSIGNED_INT to GL_UNSIGNED_SHORT.
It has been tested and works

  • on different platforms: Raspberry PI 2 and Raspberry PI 3 (both OpenGLES2), Raspberry PI 4 and Odroid XU 4 (OpenGLES3), X86-64 (OpenGLES3, OpenGL without shaders and TinyGL)
  • for different games: Grim Fandango (normal and remastered), Escape from Monkey Island (PC and PS2)

The same modification should also be done for Stark engine ... not for Myst3 and Wintermute.

This merge has initially been proposed on ResidualVM project.
See residualvm/residualvm#1519 for the corresponding issue and details.

…_INT (not supported for GLES <= 2)
@aquadran aquadran merged commit 741cd5d into scummvm:master Nov 12, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deepcode-ci-bot Well done, no issues found!
Details
@lmerckx lmerckx deleted the lmerckx:grim_compat_gles2 branch Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.