當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。