当前位置: 首页>>代码示例>>Java>>正文


Java EGL10类代码示例

本文整理汇总了Java中javax.microedition.khronos.egl.EGL10的典型用法代码示例。如果您正苦于以下问题:Java EGL10类的具体用法?Java EGL10怎么用?Java EGL10使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EGL10类属于javax.microedition.khronos.egl包,在下文中一共展示了EGL10类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: release

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public void release() {
    if (mEGL != null) {
        if (mEGL.eglGetCurrentContext().equals(mEGLContext)) {
            mEGL.eglMakeCurrent(mEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
        }
        mEGL.eglDestroySurface(mEGLDisplay, mEGLSurface);
        mEGL.eglDestroyContext(mEGLDisplay, mEGLContext);
    }
    mSurface.release();
    mEGLDisplay = null;
    mEGLContext = null;
    mEGLSurface = null;
    mEGL = null;
    mTextureRender = null;
    mSurface = null;
    mSurfaceTexture = null;
}
 
开发者ID:fishwjy,项目名称:VideoCompressor,代码行数:18,代码来源:OutputSurface.java

示例2: createWindowSurface

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
    } catch (IllegalArgumentException e) {
        // This exception indicates that the surface flinger surface
        // is not valid. This can happen if the surface flinger surface has
        // been torn down, but the application has not yet been
        // notified via SurfaceHolder.Callback.surfaceDestroyed.
        // In theory the application should be notified first,
        // but in practice sometimes it is not. See b/4588890
        Log.e(TAG, "eglCreateWindowSurface", e);
    }
    return result;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:17,代码来源:GLTextureView.java

示例3: chooseConfig

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {

            // Get the number of minimally matching EGL configurations
            int[] num_config = new int[1];
            egl.eglChooseConfig(display, s_configAttribs2, null, 0, num_config);

            int numConfigs = num_config[0];

            if (numConfigs <= 0) {
                throw new IllegalArgumentException("No configs match configSpec");
            }

            // Allocate then read the array of minimally matching EGL configs
            EGLConfig[] configs = new EGLConfig[numConfigs];
            egl.eglChooseConfig(display, s_configAttribs2, configs, numConfigs, num_config);

            if (DEBUG) {
                printConfigs(egl, display, configs);
            }
            // Now return the "best" one
            return chooseConfig(egl, display, configs);
        }
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:23,代码来源:ViEAndroidGLES20.java

示例4: createContext

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
    Log.d(LOG_TAG, "createContext " + egl + " " + display + " " + eglConfig);
    checkEglError("before createContext", egl);
    int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};

    EGLContext ctx;

    if (mRenderer.mEGLCurrentContext == null) {
        mRenderer.mEGLCurrentContext = egl.eglCreateContext(display, eglConfig,
                EGL10.EGL_NO_CONTEXT, attrib_list);
        ctx = mRenderer.mEGLCurrentContext;
    } else {
        ctx = mRenderer.mEGLCurrentContext;
    }
    checkEglError("after createContext", egl);
    return ctx;
}
 
开发者ID:AgoraIO,项目名称:Agora-Video-Source-Android,代码行数:18,代码来源:CustomizedCameraRenderer.java

示例5: chooseConfig

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
    int[] num_config = new int[1];
    if (!egl.eglChooseConfig(display, mConfigSpec, null, 0,
            num_config)) {
        throw new IllegalArgumentException("eglChooseConfig failed");
    }

    int numConfigs = num_config[0];

    if (numConfigs <= 0) {
        throw new IllegalArgumentException(
                "No configs match configSpec");
    }

    EGLConfig[] configs = new EGLConfig[numConfigs];
    if (!egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs,
            num_config)) {
        throw new IllegalArgumentException("eglChooseConfig#2 failed");
    }
    EGLConfig config = chooseConfig(egl, display, configs);
    if (config == null) {
        throw new IllegalArgumentException("No config chosen");
    }
    return config;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:26,代码来源:GLSurfaceView.java

示例6: ComponentSizeChooser

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public ComponentSizeChooser(int redSize, int greenSize, int blueSize,
                            int alphaSize, int depthSize, int stencilSize) {
    super(new int[] {
            EGL10.EGL_RED_SIZE, redSize,
            EGL10.EGL_GREEN_SIZE, greenSize,
            EGL10.EGL_BLUE_SIZE, blueSize,
            EGL10.EGL_ALPHA_SIZE, alphaSize,
            EGL10.EGL_DEPTH_SIZE, depthSize,
            EGL10.EGL_STENCIL_SIZE, stencilSize,
            EGL10.EGL_NONE});
    mValue = new int[1];
    mRedSize = redSize;
    mGreenSize = greenSize;
    mBlueSize = blueSize;
    mAlphaSize = alphaSize;
    mDepthSize = depthSize;
    mStencilSize = stencilSize;
}
 
开发者ID:pavelsemak,项目名称:alpha-movie,代码行数:19,代码来源:GLTextureView.java

示例7: start

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public void start() {
  mEgl = (EGL10) EGLContext.getEGL();
  mEglDisplay = mEgl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);

  if (mEglDisplay == EGL10.EGL_NO_DISPLAY) {
    throw new RuntimeException("eglGetDisplay failed");
  }

  int[] version = new int[2];
  if (!mEgl.eglInitialize(mEglDisplay, version)) {
    throw new RuntimeException("eglInitialize failed");
  }
  mEglConfig = mEGLConfigChooser.chooseConfig(mEgl, mEglDisplay);

  mEglContext = mEGLContextFactory.createContext(mEgl, mEglDisplay, mEglConfig);
  if (mEglContext == null || mEglContext == EGL10.EGL_NO_CONTEXT) {
    mEglContext = null;
    throwEglException("createContext");
  }

  mEglSurface = null;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:23,代码来源:EGL.java

示例8: chooseConfig

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
private EGLConfig chooseConfig() {
    int[] attribList = new int[] {
            EGL_DEPTH_SIZE, 0,
            EGL_STENCIL_SIZE, 0,
            EGL_RED_SIZE, 8,
            EGL_GREEN_SIZE, 8,
            EGL_BLUE_SIZE, 8,
            EGL_ALPHA_SIZE, 8,
            EGL10.EGL_RENDERABLE_TYPE, 4,
            EGL_NONE
    };

    // No error checking performed, minimum required code to elucidate logic
    // Expand on this logic to be more selective in choosing a configuration
    int[] numConfig = new int[1];
    mEGL.eglChooseConfig(mEGLDisplay, attribList, null, 0, numConfig);
    int configSize = numConfig[0];
    mEGLConfigs = new EGLConfig[configSize];
    mEGL.eglChooseConfig(mEGLDisplay, attribList, mEGLConfigs, configSize, numConfig);

    if (LIST_CONFIGS) {
        listConfig();
    }

    return mEGLConfigs[0]; // Best match is probably the first configuration
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:27,代码来源:PixelBuffer.java

示例9: initDrawContext

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public void initDrawContext(
            EGL10 egl,
            EGLDisplay eglDisplay,
            EGLSurface eglSurface,
            EGLContext eglContext)
    {
        mEgl = egl;
        mEglDisplay = eglDisplay;
        mEglSurface = eglSurface;
        mEglContext = eglContext;

        if (0 == mMapId) { return; }

//        makeCurrent();
        Api.ngsMapInit(mMapId);
    }
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:17,代码来源:MapDrawing.java

示例10: swap

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public boolean swap() {
  if (!mEgl.eglSwapBuffers(mEglDisplay, mEglSurface)) {
    int error = mEgl.eglGetError();
    switch (error) {
      case EGL11.EGL_CONTEXT_LOST:
        return false;
      case EGL10.EGL_BAD_NATIVE_WINDOW:
        Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId());
        break;
      case EGL10.EGL_BAD_SURFACE:
        Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_SURFACE. tid=" + Thread.currentThread().getId());
        return false;
      default:
        throwEglException("eglSwapBuffers", error);
    }
  }
  return true;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:19,代码来源:EGL.java

示例11: throwEglException

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public static void throwEglException(
        EGL10 egl,
        String function)
{
    int error;
    StringBuilder sb = new StringBuilder();
    while ((error = egl.eglGetError()) != EGL10.EGL_SUCCESS) {
        sb.append(getErrorString(error)).append("\n");
    }

    String message = function + " failed";
    if (sb.length() > 0) {
        message += ": " + sb.toString();
    }

    Log.e(ConstantsUI.TAG, message);
    throw new RuntimeException(message);
}
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:19,代码来源:MapGlView.java

示例12: ComponentSizeChooser

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public ComponentSizeChooser(int redSize, int greenSize, int blueSize,
                            int alphaSize, int depthSize, int stencilSize) {
    super(new int[]{
            EGL10.EGL_RED_SIZE, redSize,
            EGL10.EGL_GREEN_SIZE, greenSize,
            EGL10.EGL_BLUE_SIZE, blueSize,
            EGL10.EGL_ALPHA_SIZE, alphaSize,
            EGL10.EGL_DEPTH_SIZE, depthSize,
            EGL10.EGL_STENCIL_SIZE, stencilSize,
            EGL10.EGL_NONE});
    mValue = new int[1];
    mRedSize = redSize;
    mGreenSize = greenSize;
    mBlueSize = blueSize;
    mAlphaSize = alphaSize;
    mDepthSize = depthSize;
    mStencilSize = stencilSize;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:19,代码来源:GLSurfaceView.java

示例13: createContext

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
@Override
public EGLContext createContext(
        EGL10 egl,
        EGLDisplay display,
        EGLConfig eglConfig)
{
    Log.w(ConstantsUI.TAG, "creating OpenGL ES 2.0 context");
    checkEglError(egl, "Before eglCreateContext");
    int[] attrib_list = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE};
    mEglContext =
            egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, attrib_list);
    if (EGL10.EGL_NO_CONTEXT == mEglContext) {
        throwEglException(egl, "eglCreateContext");
    }
    return mEglContext;
}
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:17,代码来源:MapGlView.java

示例14: chooseConfig

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
public EGLConfig chooseConfig(EGL10 egl, EGLDisplay display) {
	int[] num_config = new int[1];
	egl.eglChooseConfig(display, mConfigSpec, null, 0, num_config);

	int numConfigs = num_config[0];

	if (numConfigs <= 0) {
		throw new IllegalArgumentException("No configs match configSpec");
	}

	EGLConfig[] configs = new EGLConfig[numConfigs];
	egl.eglChooseConfig(display, mConfigSpec, configs, numConfigs,
			num_config);
	EGLConfig config = chooseConfig(egl, display, configs);
	if (config == null) {
		throw new IllegalArgumentException("No config chosen");
	}
	return config;
}
 
开发者ID:biezhihua,项目名称:Android_OpenGL_Demo,代码行数:20,代码来源:GLWallpaperService.java

示例15: chooseConfig

import javax.microedition.khronos.egl.EGL10; //导入依赖的package包/类
@Override
            public EGLConfig chooseConfig(final EGL10 egl, final EGLDisplay display) {

                //Querying number of configurations
                final int[] num_conf = new int[1];
//                egl.eglGetConfigs(display, null, 0, num_conf); //if configuration array is null it still returns the number of configurations
                final int configurations = num_conf[0];

                //Querying actual configurations
                final EGLConfig[] conf = new EGLConfig[configurations];
//                egl.eglGetConfigs(display, conf, configurations, num_conf);

                EGLConfig result = null;

                for (int i = 0; i < configurations; i++) {
                    result = better(result, conf[i], egl, display);

                    /*final Egl config = new Egl(egl, display, conf[i]);
                    if (config.EGL_RED_SIZE + config.EGL_BLUE_SIZE + config.EGL_GREEN_SIZE + config.EGL_ALPHA_SIZE >= 16)
                        info.eglconfigs.add(config);*/
                }

                return result;
            }
 
开发者ID:QuixomTech,项目名称:DeviceInfo,代码行数:25,代码来源:GPU.java


注:本文中的javax.microedition.khronos.egl.EGL10类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。