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


Java EGL14.EGL_NO_SURFACE属性代码示例

本文整理汇总了Java中android.opengl.EGL14.EGL_NO_SURFACE属性的典型用法代码示例。如果您正苦于以下问题:Java EGL14.EGL_NO_SURFACE属性的具体用法?Java EGL14.EGL_NO_SURFACE怎么用?Java EGL14.EGL_NO_SURFACE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.opengl.EGL14的用法示例。


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

示例1: createGLESWithPBuffer

public EGLSurface createGLESWithPBuffer(EGLConfigAttrs attrs,EGLContextAttrs ctxAttrs,int width,int height){
    EGLConfig config=getConfig(attrs.surfaceType(EGL14.EGL_PBUFFER_BIT));
    if(config==null){
        log("getConfig failed : "+EGL14.eglGetError());
        return null;
    }
    EGLContext eglContext=createContext(config,EGL14.EGL_NO_CONTEXT,ctxAttrs);
    if(eglContext==EGL14.EGL_NO_CONTEXT){
        log("createContext failed : "+EGL14.eglGetError());
        return null;
    }
    EGLSurface eglSurface=createPBufferSurface(config,width,height);
    if(eglSurface==EGL14.EGL_NO_SURFACE){
        log("createWindowSurface failed : "+EGL14.eglGetError());
        return null;
    }
    if(!EGL14.eglMakeCurrent(mEGLDisplay,eglSurface,eglSurface,eglContext)){
        log("eglMakeCurrent failed : "+EGL14.eglGetError());
        return null;
    }
    return eglSurface;
}
 
开发者ID:aiyaapp,项目名称:AAVT,代码行数:22,代码来源:EglHelper.java

示例2: makeCurrent

/**
	 * change context to draw this window surface
	 * @return
	 */
	private 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 == EGL14.EGL_NO_SURFACE) {
            final int error = EGL14.eglGetError();
            if (error == EGL14.EGL_BAD_NATIVE_WINDOW) {
                Log.e(TAG, "makeCurrent:returned EGL_BAD_NATIVE_WINDOW.");
            }
            return false;
        }
        // attach EGL renderring context to specific EGL window surface
        if (!EGL14.eglMakeCurrent(mEglDisplay, surface, surface, mEglContext)) {
            Log.w(TAG, "eglMakeCurrent:" + EGL14.eglGetError());
            return false;
        }
        return true;
	}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:23,代码来源:EGLBase.java

示例3: swapBuffers

@Override
public void swapBuffers(long timestampNs) {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't swap buffers");
  }
  synchronized (EglBase.lock) {
    // See
    // https://android.googlesource.com/platform/frameworks/native/+/tools_r22.2/opengl/specs/EGL_ANDROID_presentation_time.txt
    if (timestampNs != -1) {
      EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, timestampNs);
    }
    EGL14.eglSwapBuffers(eglDisplay, eglSurface);
  }
}
 
开发者ID:Piasy,项目名称:VideoCRE,代码行数:15,代码来源:EglBase14.java

示例4: createWindowSurface

/**
 * Creates a window surface.
 * <p>
 *
 * @param surface May be a Surface or SurfaceTexture.
 */
public void createWindowSurface(Object surface) {
    if (mEGLSurface != EGL14.EGL_NO_SURFACE) {
        throw new IllegalStateException("surface already created");
    }
    mEGLSurface = mEglCore.createWindowSurface(surface);

    // Don't cache width/height here, because the size of the underlying surface can change
    // out from under us (see e.g. HardwareScalerActivity).
    //mWidth = mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH);
    //mHeight = mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT);
}
 
开发者ID:vipycm,项目名称:mao-android,代码行数:17,代码来源:EglSurfaceBase.java

示例5: makeCurrent

@Override
public void makeCurrent() {
  checkIsNotReleased();
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("No EGLSurface - can't make current");
  }
  synchronized (EglBase.lock) {
    if (!EGL14.eglMakeCurrent(eglDisplay, eglSurface, eglSurface, eglContext)) {
      throw new RuntimeException(
          "eglMakeCurrent failed: 0x" + Integer.toHexString(EGL14.eglGetError()));
    }
  }
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:13,代码来源:EglBase14.java

示例6: createPbufferSurface

@Override
public void createPbufferSurface(int width, int height) {
  checkIsNotReleased();
  if (eglSurface != EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("Already has an EGLSurface");
  }
  int[] surfaceAttribs = {EGL14.EGL_WIDTH, width, EGL14.EGL_HEIGHT, height, EGL14.EGL_NONE};
  eglSurface = EGL14.eglCreatePbufferSurface(eglDisplay, eglConfig, surfaceAttribs, 0);
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("Failed to create pixel buffer surface with size " + width + "x"
        + height + ": 0x" + Integer.toHexString(EGL14.eglGetError()));
  }
}
 
开发者ID:lgyjg,项目名称:AndroidRTC,代码行数:13,代码来源:EglBase14.java

示例7: createWindowSurface

/**
 * Creates a window surface.
 * <p>
 * @param surface May be a Surface or SurfaceTexture.
 */
public void createWindowSurface(Object surface) {
    if (mEGLSurface != EGL14.EGL_NO_SURFACE) {
        throw new IllegalStateException("surface already created");
    }
    mEGLSurface = mEglCore.createWindowSurface(surface);
    // Don't cache width/height here, because the size of the underlying surface can change
    // out from under us (see e.g. HardwareScalerActivity).
    //mWidth = mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH);
    //mHeight = mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT);
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:15,代码来源:EglSurfaceBase.java

示例8: createOffscreenSurface

/**
 * Creates an off-screen surface.
 */
public void createOffscreenSurface(int width, int height) {
    if (mEGLSurface != EGL14.EGL_NO_SURFACE) {
        throw new IllegalStateException("surface already created");
    }
    mEGLSurface = mEglCore.createOffscreenSurface(width, height);
    mWidth = width;
    mHeight = height;
}
 
开发者ID:zhangyaqiang,项目名称:Fatigue-Detection,代码行数:11,代码来源:EglSurfaceBase.java

示例9: createSurfaceInternal

private void createSurfaceInternal(Object surface) {
  if (!(surface instanceof Surface) && !(surface instanceof SurfaceTexture)) {
    throw new IllegalStateException("Input must be either a Surface or SurfaceTexture");
  }
  checkIsNotReleased();
  if (eglSurface != EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException("Already has an EGLSurface");
  }
  int[] surfaceAttribs = {EGL14.EGL_NONE};
  eglSurface = EGL14.eglCreateWindowSurface(eglDisplay, eglConfig, surface, surfaceAttribs, 0);
  if (eglSurface == EGL14.EGL_NO_SURFACE) {
    throw new RuntimeException(
        "Failed to create window surface: 0x" + Integer.toHexString(EGL14.eglGetError()));
  }
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:15,代码来源:EglBase14.java

示例10: destroyWindowSurface

private void destroyWindowSurface(EGLSurface surface) {
	if (DEBUG) Log.v(TAG, "destroySurface:");

       if (surface != EGL14.EGL_NO_SURFACE) {
       	EGL14.eglMakeCurrent(mEglDisplay,
       		EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT);
       	EGL14.eglDestroySurface(mEglDisplay, surface);
       }
       surface = EGL14.EGL_NO_SURFACE;
       if (DEBUG) Log.v(TAG, "destroySurface:finished");
}
 
开发者ID:FacePlusPlus,项目名称:MegviiFacepp-Android-SDK,代码行数:11,代码来源:EGLBase.java

示例11: createWindowSurface

public void createWindowSurface(Object surface) {
    if (mEGLSurface != EGL14.EGL_NO_SURFACE) {
        throw new IllegalStateException("surface already created");
    }
    mEGLSurface = mEglCore.createWindowSurface(surface);

    // Don't cache width/height here, because the size of the underlying surface can change
    // out from under us (see e.g. HardwareScalerActivity).
    // mWidth = mEglCore.querySurface(mEGLSurface, EGL14.EGL_WIDTH);
    // mHeight = mEglCore.querySurface(mEGLSurface, EGL14.EGL_HEIGHT);
}
 
开发者ID:AgoraIO,项目名称:Agora-Screen-Sharing-Android,代码行数:11,代码来源:EglSurfaceBase.java

示例12: release

public void release() {
    mEgl.makeDefault();
    mEgl.destroyWindowSurface(mEglSurface);
    mEglSurface = EGL14.EGL_NO_SURFACE;
}
 
开发者ID:uestccokey,项目名称:EZFilter,代码行数:5,代码来源:EGLEnvironment.java

示例13: releaseEglSurface

/**
 * Release the EGL surface.
 */
public void releaseEglSurface() {
    mEglCore.releaseSurface(mEGLSurface);
    mEGLSurface = EGL14.EGL_NO_SURFACE;
    mWidth = mHeight = -1;
}
 
开发者ID:AndyZhu1991,项目名称:grafika,代码行数:8,代码来源:EglSurfaceBase.java


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