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


Java EGLSurface类代码示例

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


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

示例1: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的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:pavelsemak,项目名称:alpha-movie,代码行数:17,代码来源:GLTextureView.java

示例2: initDrawContext

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的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

示例3: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
public EGLSurface createWindowSurface(
        EGL10 egl,
        EGLDisplay display,
        EGLConfig config,
        Object nativeWindow)
{
    mEglSurface = null;
    try {
        mEglSurface = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
        if (EGL10.EGL_NO_SURFACE == mEglSurface) {
            throwEglException(egl, "eglCreateWindowSurface");
        }
    } catch (IllegalArgumentException e) {
        Log.e(ConstantsUI.TAG, "eglCreateWindowSurface", e);
        throw new RuntimeException("eglCreateWindowSurface", e);
    }
    return mEglSurface;
}
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:19,代码来源:MapGlView.java

示例4: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
@Override
public EGLSurface createWindowSurface(EGL10 egl, EGLDisplay display,
                                      EGLConfig config, Object nativeWindow) {

    int[] surfaceAttribs = {
            EGL10.EGL_NONE
    };
    EGLSurface result = null;
    try {
        result = egl.eglCreateWindowSurface(display, config, nativeWindow, surfaceAttribs);
    } 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("DefaultWindow", "eglCreateWindowSurface", e);
    }
    return result;
}
 
开发者ID:ChillingVan,项目名称:android-openGL-canvas,代码行数:22,代码来源:GLThread.java

示例5: makeCurrent

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
/**
	 * change context to draw this window surface
	 * @return
	 */
	private final boolean makeCurrent(final EGLSurface surface) {
//		if (DEBUG) Log.v(TAG, "makeCurrent:");
/*		if (mEglDisplay == null) {
            if (DEBUG) Log.d(TAG, "makeCurrent:eglDisplay not initialized");
        } */
        if (surface == null || surface == EGL10.EGL_NO_SURFACE) {
            final int error = mEgl.eglGetError();
            if (error == EGL10.EGL_BAD_NATIVE_WINDOW) {
                Log.e(TAG, "makeCurrent:EGL_BAD_NATIVE_WINDOW");
            }
            return false;
        }
        // attach EGL rendering context to specific EGL window surface
        if (!mEgl.eglMakeCurrent(mEglDisplay, surface, surface, mContext.eglContext)) {
			Log.w("TAG", "eglMakeCurrent" + mEgl.eglGetError());
			return false;
        }
        return true;
	}
 
开发者ID:saki4510t,项目名称:libcommon,代码行数:24,代码来源:EGLBase10.java

示例6: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
@Override
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:iQuick,项目名称:NewsMe,代码行数:20,代码来源:GLSurfaceView.java

示例7: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
public EGLSurface createWindowSurface(
        EGL10 egl,
        EGLDisplay display,
        EGLConfig config,
        Object nativeWindow)
{
    mEglSurface = null;
    try {
        mEglSurface = egl.eglCreateWindowSurface(display, config, nativeWindow, null);
        if (EGL10.EGL_NO_SURFACE == mEglSurface) {
            throwEglException(egl, "eglCreateWindowSurface");
        }
    } catch (IllegalArgumentException e) {
        Log.e(Constants.TAG, "eglCreateWindowSurface", e);
        throw new RuntimeException("eglCreateWindowSurface", e);
    }
    return mEglSurface;
}
 
开发者ID:nextgis,项目名称:android_gl_viewer,代码行数:19,代码来源:MapGlView.java

示例8: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的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:wasabeef,项目名称:android-RoundedTextureView,代码行数:17,代码来源:GLTextureView.java

示例9: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的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 SurfaceTexture.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:sujitkjha,项目名称:360-Video-Player-for-Android,代码行数:17,代码来源:RajawaliTextureView.java

示例10: createWindowSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的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:shchurov,项目名称:ParticleView,代码行数:17,代码来源:GlTextureView.java

示例11: addExtensionsForConfig

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
private static void addExtensionsForConfig(EGL10 paramEGL10, EGLDisplay paramEGLDisplay, EGLConfig paramEGLConfig, int[] paramArrayOfInt1, int[] paramArrayOfInt2, Set<String> paramSet)
{
  EGLContext localEGLContext = paramEGL10.eglCreateContext(paramEGLDisplay, paramEGLConfig, EGL10.EGL_NO_CONTEXT, paramArrayOfInt2);
  if (localEGLContext == EGL10.EGL_NO_CONTEXT) {
    return;
  }
  EGLSurface localEGLSurface = paramEGL10.eglCreatePbufferSurface(paramEGLDisplay, paramEGLConfig, paramArrayOfInt1);
  if (localEGLSurface == EGL10.EGL_NO_SURFACE)
  {
    paramEGL10.eglDestroyContext(paramEGLDisplay, localEGLContext);
    return;
  }
  paramEGL10.eglMakeCurrent(paramEGLDisplay, localEGLSurface, localEGLSurface, localEGLContext);
  String str = GLES10.glGetString(7939);
  if (!TextUtils.isEmpty(str))
  {
    String[] arrayOfString = str.split(" ");
    int i = arrayOfString.length;
    for (int j = 0; j < i; j++) {
      paramSet.add(arrayOfString[j]);
    }
  }
  paramEGL10.eglMakeCurrent(paramEGLDisplay, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
  paramEGL10.eglDestroySurface(paramEGLDisplay, localEGLSurface);
  paramEGL10.eglDestroyContext(paramEGLDisplay, localEGLContext);
}
 
开发者ID:ChiangC,项目名称:FMTech,代码行数:27,代码来源:GlExtensionReader.java

示例12: clearSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
/**
 * Clears the frames from the current surface.  This should only be called when
 * the implementing video view has finished playback or otherwise released
 * the surface
 */
@Override
public void clearSurface() {
    try {
        EGL10 gl10 = (EGL10) EGLContext.getEGL();
        EGLDisplay display = gl10.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
        gl10.eglInitialize(display, null);

        EGLConfig[] configs = new EGLConfig[1];
        gl10.eglChooseConfig(display, GL_CLEAR_CONFIG_ATTRIBUTES, configs, configs.length, new int[1]);
        EGLContext context = gl10.eglCreateContext(display, configs[0], EGL10.EGL_NO_CONTEXT, GL_CLEAR_CONTEXT_ATTRIBUTES);
        EGLSurface eglSurface = gl10.eglCreateWindowSurface(display, configs[0], this, new int[]{EGL10.EGL_NONE});

        gl10.eglMakeCurrent(display, eglSurface, eglSurface, context);
        gl10.eglSwapBuffers(display, eglSurface);
        gl10.eglDestroySurface(display, eglSurface);
        gl10.eglMakeCurrent(display, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
        gl10.eglDestroyContext(display, context);

        gl10.eglTerminate(display);
    } catch (Exception e) {
        Log.e(TAG, "Error clearing surface", e);
    }
}
 
开发者ID:brianwernick,项目名称:ExoMedia,代码行数:29,代码来源:ResizingSurfaceView.java

示例13: destroySurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
public void destroySurface(
                EGL10 egl,
                EGLDisplay display,
                EGLSurface surface)
        {
//            mMapDrawing.releaseCurrent();
            if (!egl.eglDestroySurface(display, surface)) {
                throwEglException(egl, "eglDestroySurface");
            }
            mEglSurface = null;
        }
 
开发者ID:nextgis,项目名称:android_nextgis_mobile,代码行数:12,代码来源:MapGlView.java

示例14: clearSurface

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
/**
 * clear data from surface using opengl
 */
private void clearSurface(Object texture) {
  EGL10 egl = (EGL10) EGLContext.getEGL();
  EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
  egl.eglInitialize(display, null);

  int[] attribList = {
      EGL10.EGL_RED_SIZE, 8, EGL10.EGL_GREEN_SIZE, 8, EGL10.EGL_BLUE_SIZE, 8,
      EGL10.EGL_ALPHA_SIZE, 8, EGL10.EGL_RENDERABLE_TYPE, EGL10.EGL_WINDOW_BIT, EGL10.EGL_NONE, 0,
      // placeholder for recordable [@-3]
      EGL10.EGL_NONE
  };
  EGLConfig[] configs = new EGLConfig[1];
  int[] numConfigs = new int[1];
  egl.eglChooseConfig(display, attribList, configs, configs.length, numConfigs);
  EGLConfig config = configs[0];
  EGLContext context = egl.eglCreateContext(display, config, EGL10.EGL_NO_CONTEXT, new int[] {
      12440, 2, EGL10.EGL_NONE
  });
  EGLSurface eglSurface = egl.eglCreateWindowSurface(display, config, texture, new int[] {
      EGL10.EGL_NONE
  });

  egl.eglMakeCurrent(display, eglSurface, eglSurface, context);
  GLES20.glClearColor(0, 0, 0, 1);
  GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT);
  egl.eglSwapBuffers(display, eglSurface);
  egl.eglDestroySurface(display, eglSurface);
  egl.eglMakeCurrent(display, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_SURFACE, EGL10.EGL_NO_CONTEXT);
  egl.eglDestroyContext(display, context);
  egl.eglTerminate(display);
}
 
开发者ID:pedroSG94,项目名称:rtmp-rtsp-stream-client-java,代码行数:35,代码来源:Camera1ApiManager.java

示例15: eglCopyBuffers

import javax.microedition.khronos.egl.EGLSurface; //导入依赖的package包/类
public boolean eglCopyBuffers(EGLDisplay display, EGLSurface surface,
                              Object native_pixmap) {
    begin("eglCopyBuffers");
    arg("display", display);
    arg("surface", surface);
    arg("native_pixmap", native_pixmap);
    end();

    boolean result = mEgl10.eglCopyBuffers(display, surface, native_pixmap);
    returns(result);
    checkError();
    return result;
}
 
开发者ID:ChillingVan,项目名称:android-openGL-canvas,代码行数:14,代码来源:EGLLogWrapper.java


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