Java Code Examples for android.opengl.GLES30#glGetIntegerv()

The following examples show how to use android.opengl.GLES30#glGetIntegerv() . 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: GlUtil.java    From PLDroidShortVideo with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 2
Source File: GlUtil.java    From MockCamera with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 3
Source File: GlUtil.java    From pause-resume-video-recording with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 4
Source File: GlUtil.java    From LiveVideoBroadcaster with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 5
Source File: GlUtil.java    From FuAgoraDemoDroid with MIT License 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 6
Source File: GlUtil.java    From ShapesInOpenGLES2.0 with MIT License 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 7
Source File: GLUtils.java    From Fatigue-Detection with MIT License 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (CHECK_GLES30) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 8
Source File: GlUtil.java    From VIA-AI with MIT License 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 9
Source File: GlUtil.java    From AndroidPlayground with MIT License 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 10
Source File: GLUtils.java    From In77Camera with MIT License 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (CHECK_GLES30) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 11
Source File: GLUtil.java    From VideoRecorder with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 12
Source File: GlUtil.java    From PhotoMovie with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 13
Source File: GlUtil.java    From grafika with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 14
Source File: GlUtil.java    From kickflip-android-sdk with Apache License 2.0 6 votes vote down vote up
/**
 * Writes GL version info to the log.
 */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    if (false) {
        int[] values = new int[1];
        GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
        int majorVersion = values[0];
        GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
        int minorVersion = values[0];
        if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
            Log.i(TAG, "iversion: " + majorVersion + "." + minorVersion);
        }
    }
}
 
Example 15
Source File: EGLHelper.java    From citra_android with GNU General Public License v3.0 5 votes vote down vote up
public int GetVersion()
{
  int[] major = new int[1];
  int[] minor = new int[1];
  GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, major, 0);
  GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, minor, 0);
  return major[0] * 100 + minor[0] * 10;
}
 
Example 16
Source File: GlUtil.java    From sealrtc-android with MIT License 5 votes vote down vote up
/**
 * 获取 OpengGL 主版本号,在 GL 线程调用
 *
 * @return
 */
public static int getGlMajorVersion() {
    int[] values = new int[1];
    GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
    int majorVersion = values[0];
    return majorVersion;
}
 
Example 17
Source File: GlUtil.java    From sealrtc-android with MIT License 5 votes vote down vote up
/** Writes GL version info to the log. */
public static void logVersionInfo() {
    Log.i(TAG, "vendor  : " + GLES20.glGetString(GLES20.GL_VENDOR));
    Log.i(TAG, "renderer: " + GLES20.glGetString(GLES20.GL_RENDERER));
    Log.i(TAG, "version : " + GLES20.glGetString(GLES20.GL_VERSION));

    int[] values = new int[1];
    GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
    int majorVersion = values[0];
    GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
    int minorVersion = values[0];
    if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
        Log.i(TAG, "glVersion: " + majorVersion + "." + minorVersion);
    }
}
 
Example 18
Source File: GLHelper.java    From libcommon with Apache License 2.0 5 votes vote down vote up
/**
 * テクスチャ名配列を生成(前から順にGL_TEXTURE0, GL_TEXTURE1, ...)
 * @param texIds テクスチャ名配列, 最大で32個(GL_MAX_TEXTURE_IMAGE_UNITS以下)
 * @param texTarget テクスチャのタイプ, GL_TEXTURE_EXTERNAL_OESかGL_TEXTURE_2D
 * @param minFilter テクスチャの補間方法を指定, GL_LINEARとかGL_NEAREST
 * @param magFilter テクスチャの補間方法を指定, GL_LINEARとかGL_NEAREST
 * @param wrap テクスチャのクランプ方法, GL_CLAMP_TO_EDGE等
 * @return
 */
public static int[] initTexes(@NonNull final int[] texIds,
	final int texTarget, final int minFilter, final int magFilter, final int wrap) {

	int[] textureUnits = new int[1];
	GLES30.glGetIntegerv(GLES30.GL_MAX_TEXTURE_IMAGE_UNITS, textureUnits, 0);
	Log.v(TAG, "GL_MAX_TEXTURE_IMAGE_UNITS=" + textureUnits[0]);
	final int n = texIds.length > textureUnits[0]
		? textureUnits[0] : texIds.length;
	for (int i = 0; i < n; i++) {
		texIds[i] = GLHelper.initTex(texTarget, ShaderConst.TEX_NUMBERS_ES3[i],
			minFilter, magFilter, wrap);
	}
	return texIds;
}
 
Example 19
Source File: GLHelper.java    From libcommon with Apache License 2.0 5 votes vote down vote up
/**
 * テクスチャ名配列を生成(こっちは全部同じテクスチャユニット)
 * @param texIds テクスチャ名配列
 * @param texTarget テクスチャのタイプ, GL_TEXTURE_EXTERNAL_OESかGL_TEXTURE_2D
 * @param texUnit テクスチャユニット
 * @param minFilter テクスチャの補間方法を指定, GL_LINEARとかGL_NEAREST
 * @param magFilter テクスチャの補間方法を指定, GL_LINEARとかGL_NEAREST
 * @param wrap テクスチャのクランプ方法, GL_CLAMP_TO_EDGE等
 * @return
 */
public static int[] initTexes(@NonNull final int[] texIds,
	final int texTarget, final int texUnit,
	final int minFilter, final int magFilter, final int wrap) {

	int[] textureUnits = new int[1];
	GLES30.glGetIntegerv(GLES30.GL_MAX_TEXTURE_IMAGE_UNITS, textureUnits, 0);
	final int n = texIds.length > textureUnits[0]
		? textureUnits[0] : texIds.length;
	for (int i = 0; i < n; i++) {
		texIds[i] = GLHelper.initTex(texTarget, texUnit,
			minFilter, magFilter, wrap);
	}
	return texIds;
}
 
Example 20
Source File: GLContext.java    From libcommon with Apache License 2.0 5 votes vote down vote up
/**
 * 対応するOpenGL|ESのバージョンを取得する
 * @return 0以下なら何らかの理由でバージョンを取得できなかった
 * 			それ以外は整数部: メジャーバージョン, 小数部: マイナーバージョン
 */
@SuppressLint("InlinedApi")
public static float supportedGLESVersion() {
	float result = 0.0f;

	if (BuildCheck.isAndroid4_3()) {
		final int[] values = new int[1];
		GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, values, 0);
		final int majorVersion = values[0];
		GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, values, 0);
		final int minorVersion = values[0];
		if (GLES30.glGetError() == GLES30.GL_NO_ERROR) {
			result = majorVersion + minorVersion * 0.1f;
		}
	}
	if (result <= 0.0f) {
		// バージョンを取得できなかったときは
		// ro.opengles.versionプロパティからの読み込みを試みる
		final String openGLESVersionString
			= SysPropReader.read("ro.opengles.version");
		if (!TextUtils.isEmpty(openGLESVersionString)) {
			try {
				final int openGLESVersion = Integer.parseInt(openGLESVersionString);
				result = ((openGLESVersion & 0xffff0000) >> 16)
					+ 0.1f * (openGLESVersion & 0x0000ffff);
			} catch (final NumberFormatException e) {
				if (DEBUG) Log.w(TAG, e);
			}
		} else {
			if (DEBUG) Log.v(TAG, "supportedGLESVersion:has no ro.opengles.version value");
		}
	}
	return result;
}