Java Code Examples for javax.microedition.khronos.opengles.GL10#glGetString()

The following examples show how to use javax.microedition.khronos.opengles.GL10#glGetString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GLTextureView.java    From VideoRecorder with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                + mMultipleGLESContextsAllowed
                + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 2
Source File: PLOpenGLSupport.java    From panoramagl with Apache License 2.0 6 votes vote down vote up
/**
 * property methods
 */

public static PLOpenGLVersion getOpenGLVersion(GL10 gl) {
    if (sGLVersion == null) {
        if (PLUtils.isEmulator())
            sGLVersion = (PLUtils.getAndroidVersion() < 3.0f ? PLOpenGLVersion.PLOpenGLVersion1_0 : PLOpenGLVersion.PLOpenGLVersion1_1);
        else {
            String version = gl.glGetString(GL10.GL_VERSION);
            if (version.indexOf("1.0") != -1)
                sGLVersion = PLOpenGLVersion.PLOpenGLVersion1_0;
            else if (version.indexOf("1.1") != -1)
                sGLVersion = PLOpenGLVersion.PLOpenGLVersion1_1;
            else
                sGLVersion = PLOpenGLVersion.PLOpenGLVersion2_0;
        }
    }
    return sGLVersion;
}
 
Example 3
Source File: GLTextureView.java    From ZGDanmaku with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 4
Source File: GLTextureView.java    From MD360Player4Android with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 5
Source File: GlTextureView.java    From ParticleView with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 6
Source File: GLTextureView.java    From android-RoundedTextureView with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
  if (!glesDriverCheckComplete) {
    checkGLESVersion();
    String renderer = gl.glGetString(GL10.GL_RENDERER);
    if (glesVersion < kGLES_20) {
      multipleGLESContextsAllowed = !renderer.startsWith(kMSM7K_RENDERER_PREFIX);
      notifyAll();
    }
    limitedGLESContexts = !multipleGLESContextsAllowed;
    if (LOG_SURFACE) {
      Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
          + multipleGLESContextsAllowed + " limitedGLESContexts = " + limitedGLESContexts);
    }
    glesDriverCheckComplete = true;
  }
}
 
Example 7
Source File: PLOpenGLSupport.java    From PanoramaGL with Apache License 2.0 6 votes vote down vote up
/**property methods*/

public static PLOpenGLVersion getOpenGLVersion(GL10 gl)
{
	if(sGLVersion == null)
	{
		if(PLUtils.isEmulator())
			sGLVersion = (PLUtils.getAndroidVersion() < 3.0f ? PLOpenGLVersion.PLOpenGLVersion1_0 : PLOpenGLVersion.PLOpenGLVersion1_1);
		else
		{
			String version = gl.glGetString(GL10.GL_VERSION);
			if(version.indexOf("1.0") != -1)
				sGLVersion = PLOpenGLVersion.PLOpenGLVersion1_0;
			else if(version.indexOf("1.1") != -1)
				sGLVersion = PLOpenGLVersion.PLOpenGLVersion1_1;
			else
				sGLVersion = PLOpenGLVersion.PLOpenGLVersion2_0;
		}
	}
	return sGLVersion;
}
 
Example 8
Source File: GLSurfaceView.java    From NewsMe with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
	if (!mGLESDriverCheckComplete) {
		checkGLESVersion();
		String renderer = gl.glGetString(GL10.GL_RENDERER);
		if (mGLESVersion < kGLES_20) {
			mMultipleGLESContextsAllowed = !renderer
					.startsWith(kMSM7K_RENDERER_PREFIX);
			notifyAll();
		}
		mLimitedGLESContexts = !mMultipleGLESContextsAllowed
				|| renderer.startsWith(kADRENO);
		if (LOG_SURFACE) {
			Log.w(TAG, "checkGLDriver renderer = \"" + renderer
					+ "\" multipleContextsAllowed = "
					+ mMultipleGLESContextsAllowed
					+ " mLimitedGLESContexts = " + mLimitedGLESContexts);
		}
		mGLESDriverCheckComplete = true;
	}
}
 
Example 9
Source File: GLTextureView.java    From EZFilter with MIT License 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (!mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    !renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 10
Source File: GLSurfaceView.java    From EZFilter with MIT License 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (!mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    !renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 11
Source File: GLTextureView.java    From alpha-movie with Apache License 2.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 12
Source File: GLTextureView.java    From MusicPlayer with GNU General Public License v3.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 13
Source File: GLTextureView.java    From Beginner-Level-Android-Studio-Apps with GNU General Public License v3.0 6 votes vote down vote up
public synchronized void checkGLDriver(GL10 gl) {
    if (! mGLESDriverCheckComplete) {
        checkGLESVersion();
        String renderer = gl.glGetString(GL10.GL_RENDERER);
        if (mGLESVersion < kGLES_20) {
            mMultipleGLESContextsAllowed =
                    ! renderer.startsWith(kMSM7K_RENDERER_PREFIX);
            notifyAll();
        }
        mLimitedGLESContexts = !mMultipleGLESContextsAllowed;
        if (LOG_SURFACE) {
            Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = "
                    + mMultipleGLESContextsAllowed
                    + " mLimitedGLESContexts = " + mLimitedGLESContexts);
        }
        mGLESDriverCheckComplete = true;
    }
}
 
Example 14
Source File: bt.java    From letv with Apache License 2.0 5 votes vote down vote up
public static String[] a(GL10 gl10) {
    try {
        String[] strArr = new String[2];
        String glGetString = gl10.glGetString(7936);
        String glGetString2 = gl10.glGetString(7937);
        strArr[0] = glGetString;
        strArr[1] = glGetString2;
        return strArr;
    } catch (Throwable e) {
        bv.e(a, "Could not read gpu infor:", e);
        return new String[0];
    }
}
 
Example 15
Source File: MapView.java    From trekarta with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
    if (OPENGL_VERSION == 2.0)
        GLAdapter.init(new AndroidGL());
    else {
        try {
            // Create a minimum supported OpenGL ES context, then check:
            String versionString = gl.glGetString(GL10.GL_VERSION);
            log.info("Version: " + versionString);
            // The version format is displayed as: "OpenGL ES <major>.<minor>"
            // followed by optional content provided by the implementation.

            // OpenGL<space>ES<space><version number><space><vendor-specific information>.
            int[] version = extractVersion(versionString);
            int majorVersion = Math.min(version[0], (int) OPENGL_VERSION);
            if (majorVersion >= 3)
                GLAdapter.init(new AndroidGL30());
            else
                GLAdapter.init(new AndroidGL());
        } catch (Throwable t) {
            log.error("Falling back to GLES 2", t);
            GLAdapter.init(new AndroidGL());
        }
    }

    super.onSurfaceCreated();
}
 
Example 16
Source File: GOSurfaceView.java    From settlers-remake with MIT License 5 votes vote down vote up
@Override
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
	String version = gl.glGetString(GL10.GL_VERSION);
	int major = version.split(" ")[2].charAt(0)-'0';
	if(major == 1) {
		drawcontext = new GLES11DrawContext(ctx);
	} else {
		drawcontext = new GLES20DrawContext(ctx, major >= 3);
	}
}
 
Example 17
Source File: CubeMapActivity.java    From codeexamples-android with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This is not the fastest way to check for an extension, but fine if
 * we are only checking for a few extensions each time a context is created.
 * @param gl
 * @param extension
 * @return true if the extension is present in the current context.
 */
private boolean checkIfContextSupportsExtension(GL10 gl, String extension) {
    String extensions = " " + gl.glGetString(GL10.GL_EXTENSIONS) + " ";
    // The extensions string is padded with spaces between extensions, but not
    // necessarily at the beginning or end. For simplicity, add spaces at the
    // beginning and end of the extensions string and the extension string.
    // This means we can avoid special-case checks for the first or last
    // extension, as well as avoid special-case checks when an extension name
    // is the same as the first part of another extension name.
    return extensions.indexOf(" " + extension + " ") >= 0;
}
 
Example 18
Source File: FrameBufferObjectActivity.java    From codeexamples-android with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * This is not the fastest way to check for an extension, but fine if
 * we are only checking for a few extensions each time a context is created.
 * @param gl
 * @param extension
 * @return true if the extension is present in the current context.
 */
private boolean checkIfContextSupportsExtension(GL10 gl, String extension) {
    String extensions = " " + gl.glGetString(GL10.GL_EXTENSIONS) + " ";
    // The extensions string is padded with spaces between extensions, but not
    // necessarily at the beginning or end. For simplicity, add spaces at the
    // beginning and end of the extensions string and the extension string.
    // This means we can avoid special-case checks for the first or last
    // extension, as well as avoid special-case checks when an extension name
    // is the same as the first part of another extension name.
    return extensions.indexOf(" " + extension + " ") >= 0;
}