本文整理汇总了Java中android.opengl.GLES10.glGetIntegerv方法的典型用法代码示例。如果您正苦于以下问题:Java GLES10.glGetIntegerv方法的具体用法?Java GLES10.glGetIntegerv怎么用?Java GLES10.glGetIntegerv使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.opengl.GLES10
的用法示例。
在下文中一共展示了GLES10.glGetIntegerv方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isETC1Supported
import android.opengl.GLES10; //导入方法依赖的package包/类
/**
* Check if ETC1 texture compression is supported by the active OpenGL ES context.
* @return true if the active OpenGL ES context supports ETC1 texture compression.
*/
public static boolean isETC1Supported() {
int[] results = new int[20];
GLES10.glGetIntegerv(GLES10.GL_NUM_COMPRESSED_TEXTURE_FORMATS, results, 0);
int numFormats = results[0];
if (numFormats > results.length) {
results = new int[numFormats];
}
GLES10.glGetIntegerv(GLES10.GL_COMPRESSED_TEXTURE_FORMATS, results, 0);
for (int i = 0; i < numFormats; i++) {
if (results[i] == JavaETC1.ETC1_RGB8_OES) {
return true;
}
}
return false;
}
示例2: isETC1Supported
import android.opengl.GLES10; //导入方法依赖的package包/类
/**
* Check if ETC1 texture compression is supported by the active OpenGL ES context.
* @return true if the active OpenGL ES context supports ETC1 texture compression.
*/
public static boolean isETC1Supported() {
int[] results = new int[20];
GLES10.glGetIntegerv(GLES10.GL_NUM_COMPRESSED_TEXTURE_FORMATS, results, 0);
int numFormats = results[0];
if (numFormats > results.length) {
results = new int[numFormats];
}
GLES10.glGetIntegerv(GLES10.GL_COMPRESSED_TEXTURE_FORMATS, results, 0);
for (int i = 0; i < numFormats; i++) {
if (results[i] == RsETC1.ETC1_RGB8_OES) {
return true;
}
}
return false;
}
示例3: getSupportedMaxPictureSize
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getSupportedMaxPictureSize() {
int[] array = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, array, 0);
if (array[0] == 0) {
GLES11.glGetIntegerv(GLES11.GL_MAX_TEXTURE_SIZE, array, 0);
if (array[0] == 0) {
GLES20.glGetIntegerv(GLES20.GL_MAX_TEXTURE_SIZE, array, 0);
if (array[0] == 0) {
GLES30.glGetIntegerv(GLES30.GL_MAX_TEXTURE_SIZE, array, 0);
}
}
}
return array[0] != 0 ? array[0] : 2048;
}
示例4: getTextureSize
import android.opengl.GLES10; //导入方法依赖的package包/类
public static final int getTextureSize() {
if (textureSize > 0) {
return textureSize;
}
int[] params = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, params, 0);
textureSize = params[0];
return textureSize;
}
示例5: getTextureSize
import android.opengl.GLES10; //导入方法依赖的package包/类
public static final int getTextureSize() {
if (textureSize > 0) {
return textureSize;
}
int[] params = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, params, 0);
textureSize = params[0];
return textureSize;
}
示例6: getMaxSize
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getMaxSize() {
int maxSize = SIZE_DEFAULT;
int[] arr = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, arr, 0);
if (arr[0] > 0) {
maxSize = Math.min(arr[0], SIZE_LIMIT);
}
return maxSize;
}
示例7: getBitmapMaxWidthAndMaxHeight
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getBitmapMaxWidthAndMaxHeight() {
int[] maxSizeArray = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
if (maxSizeArray[0] == 0) {
GLES10.glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
}
// return maxSizeArray[0];
return 2048;
}
示例8: getMaxLeftWidthOrHeightImageViewCanRead
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getMaxLeftWidthOrHeightImageViewCanRead(int heightOrWidth) {
// 1pixel==4bytes
// http://stackoverflow.com/questions/13536042/android-bitmap-allocating-16-bytes-per-pixel
// http://stackoverflow.com/questions/15313807/android-maximum-allowed-width-height-of-bitmap
int[] maxSizeArray = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
if (maxSizeArray[0] == 0) {
GLES10.glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
}
int maxHeight = maxSizeArray[0];
int maxWidth = maxSizeArray[0];
return (maxHeight * maxWidth) / heightOrWidth;
}
示例9: getBitmapMaxWidthAndMaxHeight
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getBitmapMaxWidthAndMaxHeight() {
int[] maxSizeArray = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
if (maxSizeArray[0] == 0) {
GLES10.glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
}
// return maxSizeArray[0];
return 2048;
}
示例10: getMaxLeftWidthOrHeightImageViewCanRead
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getMaxLeftWidthOrHeightImageViewCanRead(int heightOrWidth) {
// 1pixel==4bytes
// http://stackoverflow.com/questions/13536042/android-bitmap-allocating-16-bytes-per-pixel
// http://stackoverflow.com/questions/15313807/android-maximum-allowed-width-height-of-bitmap
int[] maxSizeArray = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
if (maxSizeArray[0] == 0) {
GLES10.glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
}
int maxHeight = maxSizeArray[0];
int maxWidth = maxSizeArray[0];
return (maxHeight * maxWidth) / heightOrWidth;
}
示例11: onActivityResult
import android.opengl.GLES10; //导入方法依赖的package包/类
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data){
super.onActivityResult(requestCode, resultCode, data);
//Detects request codes
if(requestCode==GET_FROM_GALLERY && resultCode == Activity.RESULT_OK) {
Uri selectedImage = data.getData();
fileUri = selectedImage;
System.out.println("FILE URI: " + fileUri);
Bitmap bitmap = null;
int[] maxSize = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0);
try {
bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), selectedImage);
//IF IMAGE DIMENSIONS ARE BIGGER THAN SUPPORTED BY OPENGL VERSION ON HARDWARE
if(bitmap.getHeight()>=maxSize[0]||bitmap.getWidth()>=maxSize[0]){
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
int width = metrics.widthPixels;
int height = metrics.heightPixels;
bitmap = Bitmap.createScaledBitmap(bitmap, width, height, true);
System.out.println("BITMAP SIZE: "+bitmap.getWidth()+"x"+bitmap.getHeight());
}
} catch (IOException e) {
Log.e(TAG, e.getLocalizedMessage());
}
avatarPreview.setImageBitmap(bitmap);
avatarPreview.setAdjustViewBounds(true);
System.out.println("IMAGE VIEW SIZE: "+avatarPreview.getWidth()+"x"+avatarPreview.getHeight());
}
}
示例12: isNeedCloseHardwareAcceleration
import android.opengl.GLES10; //导入方法依赖的package包/类
public boolean isNeedCloseHardwareAcceleration(int w, int h) {
int[] maxSize = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSize, 0);
if (maxSize[0] < h || maxSize[0] < w) {
return true;
}
return false;
}
示例13: getMaxLeftWidthOrHeightImageViewCanRead
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getMaxLeftWidthOrHeightImageViewCanRead(int heightOrWidth) {
//1pixel==4bytes http://stackoverflow.com/questions/13536042/android-bitmap-allocating-16-bytes-per-pixel
//http://stackoverflow.com/questions/15313807/android-maximum-allowed-width-height-of-bitmap
int[] maxSizeArray = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
if (maxSizeArray[0] == 0) {
GLES10.glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
}
int maxHeight = maxSizeArray[0];
int maxWidth = maxSizeArray[0];
return (maxHeight * maxWidth) / heightOrWidth;
}
示例14: getBitmapMaxWidthAndMaxHeight
import android.opengl.GLES10; //导入方法依赖的package包/类
public static int getBitmapMaxWidthAndMaxHeight() {
int[] maxSizeArray = new int[1];
GLES10.glGetIntegerv(GL10.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
if (maxSizeArray[0] == 0) {
GLES10.glGetIntegerv(GL11.GL_MAX_TEXTURE_SIZE, maxSizeArray, 0);
}
// return maxSizeArray[0];
return 2048;
}
示例15: getMaxTextureSize
import android.opengl.GLES10; //导入方法依赖的package包/类
private int getMaxTextureSize() {
int[] maxSize = new int[1];
GLES10.glGetIntegerv(GLES10.GL_MAX_TEXTURE_SIZE, maxSize, 0);
return maxSize[0];
}