markfguerra / GLWallpaperService

Please submit issues and pull requests to the main repository
https://github.com/GLWallpaperService/GLWallpaperService
Apache License 2.0
218 stars 114 forks source link

Can't change OpenGL version from 1.1 #35

Open guyluz11 opened 4 weeks ago

guyluz11 commented 4 weeks ago

When I run my openGL code as a regular activity it runs in OpenGL version 3.0

But when I run the same code under class that extends WallpaperService I get version 1.1

I set setEGLContextClientVersion(2); and also <uses-feature android:glEsVersion="0x20000" android:required="true"/> but it does not seem to do anything.

Checking version using

   String versionString = GLES20.glGetString(GLES20.GL_VERSION);

        if (versionString == null) {
            versionString = GLES20.glGetString(GLES20.GL_VERSION);
        }
        if (versionString == null) {
            versionString = GLES30.glGetString(GLES30.GL_VERSION);
        }
        if (versionString == null) {
            versionString = GLES31.glGetString(GLES31.GL_VERSION);
        }
        if (versionString == null) {
            versionString = GLES32.glGetString(GLES32.GL_VERSION);
        }
        if (versionString == null) {
            Log.i("version of GLES", "Version didn't found" + versionString);
        }
        else {
            Log.i("version of GLES", "Version is" + versionString);
        }
        Log.i("version of GLES", "Version is" + versionString);
guyluz11 commented 4 weeks ago

This pr solved it for me https://github.com/GLWallpaperService/GLWallpaperService/pull/8#pullrequestreview-2240832610