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


Java EGL10.eglGetConfigAttrib方法代碼示例

本文整理匯總了Java中javax.microedition.khronos.egl.EGL10.eglGetConfigAttrib方法的典型用法代碼示例。如果您正苦於以下問題:Java EGL10.eglGetConfigAttrib方法的具體用法?Java EGL10.eglGetConfigAttrib怎麽用?Java EGL10.eglGetConfigAttrib使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.microedition.khronos.egl.EGL10的用法示例。


在下文中一共展示了EGL10.eglGetConfigAttrib方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getMaxTextureSize

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
public static int getMaxTextureSize() {
  final int IMAGE_MAX_BITMAP_DIMENSION = 2048;

  EGL10 egl = (EGL10) EGLContext.getEGL();
  EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

  int[] version = new int[2];
  egl.eglInitialize(display, version);

  int[] totalConfigurations = new int[1];
  egl.eglGetConfigs(display, null, 0, totalConfigurations);

  EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]];
  egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations);

  int[] textureSize = new int[1];
  int maximumTextureSize = 0;

  for (int i = 0; i < totalConfigurations[0]; i++) {
    egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize);

    if (maximumTextureSize < textureSize[0])
      maximumTextureSize = textureSize[0];
  }

  egl.eglTerminate(display);

  return Math.max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION);
}
 
開發者ID:XecureIT,項目名稱:PeSanKita-android,代碼行數:30,代碼來源:BitmapUtil.java

示例2: findConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private int findConfigAttrib(EGL10 egl, EGLDisplay display,
        EGLConfig config, int attribute, int defaultValue) {

    if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
        return mValue[0];
    }
    return defaultValue;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:9,代碼來源:ViEAndroidGLES20.java

示例3: findConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private int findConfigAttrib(EGL10 egl, EGLDisplay display,
                             EGLConfig config, int attribute, int defaultValue) {

    if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
        return mValue[0];
    }
    return defaultValue;
}
 
開發者ID:pavelsemak,項目名稱:alpha-movie,代碼行數:9,代碼來源:GLTextureView.java

示例4: findConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
protected int findConfigAttrib(
        EGL10 egl,
        EGLDisplay display,
        EGLConfig config,
        int attribute,
        int defaultValue)
{

    if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
        return mValue[0];
    }
    return defaultValue;
}
 
開發者ID:nextgis,項目名稱:android_nextgis_mobile,代碼行數:14,代碼來源:MapGlView.java

示例5: getMaxTextureSize

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
public static int getMaxTextureSize() {
    // Safe minimum default size
    final int IMAGE_MAX_BITMAP_DIMENSION = 2048;

    // Get EGL Display
    EGL10 egl = (EGL10) EGLContext.getEGL();
    EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

    // Initialise
    int[] version = new int[2];
    egl.eglInitialize(display, version);

    // Query total number of configurations
    int[] totalConfigurations = new int[1];
    egl.eglGetConfigs(display, null, 0, totalConfigurations);

    // Query actual list configurations
    EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]];
    egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations);

    int[] textureSize = new int[1];
    int maximumTextureSize = 0;

    // Iterate through all the configurations to located the maximum texture size
    for (int i = 0; i < totalConfigurations[0]; i++) {
        // Only need to check for width since opengl textures are always squared
        egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize);

        // Keep track of the maximum texture size
        if (maximumTextureSize < textureSize[0])
            maximumTextureSize = textureSize[0];
    }

    // Release
    egl.eglTerminate(display);

    // Return largest texture size found, or default
    return Math.max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION);
}
 
開發者ID:Assassinss,項目名稱:Moment,代碼行數:40,代碼來源:TextureSizeUtils.java

示例6: findConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private int findConfigAttrib(EGL10 egl, EGLDisplay display,
		EGLConfig config, int attribute, int defaultValue) {

	if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
		return mValue[0];
	}
	return defaultValue;
}
 
開發者ID:biezhihua,項目名稱:Android_OpenGL_Demo,代碼行數:9,代碼來源:GLWallpaperService.java

示例7: findConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private int findConfigAttrib(EGL10 egl, EGLDisplay display, EGLConfig config, int attribute, int defaultValue) {

      if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
        return mValue[0];
      }
      return defaultValue;
    }
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:8,代碼來源:EGL.java

示例8: better

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
/**
 * Returns the best of the two EGLConfig passed according to depth and colours
 *
 * @param a The first candidate
 * @param b The second candidate
 * @return The chosen candidate
 */
private EGLConfig better(EGLConfig a, EGLConfig b, EGL10 egl, EGLDisplay display) {
    if (a == null) return b;

    EGLConfig result;

    int[] value = new int[1];

    egl.eglGetConfigAttrib(display, a, EGL10.EGL_DEPTH_SIZE, value);
    int depthA = value[0];

    egl.eglGetConfigAttrib(display, b, EGL10.EGL_DEPTH_SIZE, value);
    int depthB = value[0];

    if (depthA > depthB)
        result = a;
    else if (depthA < depthB)
        result = b;
    else //if depthA == depthB
    {
        egl.eglGetConfigAttrib(display, a, EGL10.EGL_RED_SIZE, value);
        int redA = value[0];

        egl.eglGetConfigAttrib(display, b, EGL10.EGL_RED_SIZE, value);
        int redB = value[0];

        if (redA > redB)
            result = a;
        else if (redA < redB)
            result = b;
        else //if redA == redB
        {
            //Don't care
            result = a;
        }
    }

    return result;
}
 
開發者ID:QuixomTech,項目名稱:DeviceInfo,代碼行數:46,代碼來源:GPU.java

示例9: findConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
private int findConfigAttrib(EGL10 egl, EGLDisplay display,
		EGLConfig config, int attribute, int defaultValue) {
	mValue[0] = -1;
	if (egl.eglGetConfigAttrib(display, config, attribute, mValue)) {
		return mValue[0];
	}
	Log.w("SDL", "GLSurfaceView_SDL::EGLConfigChooser::findConfigAttrib(): attribute doesn't exist: " + attribute);
	return defaultValue;
}
 
開發者ID:NeoTerm,項目名稱:NeoTerm,代碼行數:10,代碼來源:GLSurfaceView_SDL.java

示例10: getMaxTextureSize

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
/**
 * Get the max size of bitmap allowed to be rendered on the device.<br>
 * http://stackoverflow.com/questions/7428996/hw-accelerated-activity-how-to-get-opengl-texture-size-limit.
 */
private static int getMaxTextureSize() {
    // Safe minimum default size
    final int IMAGE_MAX_BITMAP_DIMENSION = 2048;

    try {
        // Get EGL Display
        EGL10 egl = (EGL10) EGLContext.getEGL();
        EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

        // Initialise
        int[] version = new int[2];
        egl.eglInitialize(display, version);

        // Query total number of configurations
        int[] totalConfigurations = new int[1];
        egl.eglGetConfigs(display, null, 0, totalConfigurations);

        // Query actual list configurations
        EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]];
        egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations);

        int[] textureSize = new int[1];
        int maximumTextureSize = 0;

        // Iterate through all the configurations to located the maximum texture size
        for (int i = 0; i < totalConfigurations[0]; i++) {
            // Only need to check for width since opengl textures are always squared
            egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize);

            // Keep track of the maximum texture size
            if (maximumTextureSize < textureSize[0]) {
                maximumTextureSize = textureSize[0];
            }
        }

        // Release
        egl.eglTerminate(display);

        // Return largest texture size found, or default
        return Math.max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION);
    } catch (Exception e) {
        return IMAGE_MAX_BITMAP_DIMENSION;
    }
}
 
開發者ID:garretyoder,項目名稱:Cluttr,代碼行數:49,代碼來源:BitmapUtils.java

示例11: eglGetConfigAttrib

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
public synchronized static int eglGetConfigAttrib(int eglType, final EGL10 egl, final EGLDisplay display, final EGLConfig eglConfig) {
    egl.eglGetConfigAttrib(display, eglConfig, eglType, arrayBuffer);
    return arrayBuffer[0];
}
 
開發者ID:QuixomTech,項目名稱:DeviceInfo,代碼行數:5,代碼來源:GPU.java

示例12: getMaxTextureSize

import javax.microedition.khronos.egl.EGL10; //導入方法依賴的package包/類
/**
 * Get the max size of bitmap allowed to be rendered on the device.<br>
 * http://stackoverflow.com/questions/7428996/hw-accelerated-activity-how-to-get-opengl-texture-size-limit.
 */
private static int getMaxTextureSize() {
  // Safe minimum default size
  final int IMAGE_MAX_BITMAP_DIMENSION = 2048;

  try {
    // Get EGL Display
    EGL10 egl = (EGL10) EGLContext.getEGL();
    EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

    // Initialise
    int[] version = new int[2];
    egl.eglInitialize(display, version);

    // Query total number of configurations
    int[] totalConfigurations = new int[1];
    egl.eglGetConfigs(display, null, 0, totalConfigurations);

    // Query actual list configurations
    EGLConfig[] configurationsList = new EGLConfig[totalConfigurations[0]];
    egl.eglGetConfigs(display, configurationsList, totalConfigurations[0], totalConfigurations);

    int[] textureSize = new int[1];
    int maximumTextureSize = 0;

    // Iterate through all the configurations to located the maximum texture size
    for (int i = 0; i < totalConfigurations[0]; i++) {
      // Only need to check for width since opengl textures are always squared
      egl.eglGetConfigAttrib(
          display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize);

      // Keep track of the maximum texture size
      if (maximumTextureSize < textureSize[0]) {
        maximumTextureSize = textureSize[0];
      }
    }

    // Release
    egl.eglTerminate(display);

    // Return largest texture size found, or default
    return Math.max(maximumTextureSize, IMAGE_MAX_BITMAP_DIMENSION);
  } catch (Exception e) {
    return IMAGE_MAX_BITMAP_DIMENSION;
  }
}
 
開發者ID:prashantsaini1,項目名稱:android-titanium-imagecropper,代碼行數:50,代碼來源:BitmapUtils.java


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