當前位置: 首頁>>代碼示例>>Java>>正文


Java GLES10.glGetIntegerv方法代碼示例

本文整理匯總了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;
}
 
開發者ID:nicastel,項目名稱:renderscript_texture_compressor,代碼行數:20,代碼來源:JavaETC1Util.java

示例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;
}
 
開發者ID:nicastel,項目名稱:renderscript_texture_compressor,代碼行數:20,代碼來源:RsETC1Util.java

示例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;
}
 
開發者ID:PeterCxy,項目名稱:BlackLight,代碼行數:19,代碼來源:Utility.java

示例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;		
}
 
開發者ID:newDeepLearing,項目名稱:decoy,代碼行數:12,代碼來源:SampleSizeUtil.java

示例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;
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:12,代碼來源:SampleSizeUtil.java

示例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;
}
 
開發者ID:jeanboydev,項目名稱:Android-CropView,代碼行數:10,代碼來源:Utils.java

示例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;
}
 
開發者ID:huijimuhe,項目名稱:monolog-android,代碼行數:11,代碼來源:ImageUtils.java

示例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;
}
 
開發者ID:lookwhatlook,項目名稱:WeiboWeiBaTong,代碼行數:16,代碼來源:Utility.java

示例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;
}
 
開發者ID:lookwhatlook,項目名稱:WeiboWeiBaTong,代碼行數:11,代碼來源:Utility.java

示例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;
}
 
開發者ID:jas0nchen,項目名稱:X.Ray,代碼行數:16,代碼來源:Utility.java

示例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());
    }
}
 
開發者ID:DiogoPeres,項目名稱:WhosUp,代碼行數:34,代碼來源:UpdateMyProfileActivity.java

示例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;
}
 
開發者ID:succlz123,項目名稱:S1-Go,代碼行數:11,代碼來源:MyUtils.java

示例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;
}
 
開發者ID:shawnlinboy,項目名稱:siciyuan,代碼行數:15,代碼來源:Utility.java

示例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;
    }
 
開發者ID:shawnlinboy,項目名稱:siciyuan,代碼行數:11,代碼來源:Utility.java

示例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];
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:6,代碼來源:ImageCropActivity.java


注:本文中的android.opengl.GLES10.glGetIntegerv方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。