东莞网站开发哪家强,访问网站出来的是目录,南宁建设信息网站,偃师网站目录
一. EGL 前言二. EGL 绘制流程简介三.eglDestroyContext 函数简介 四.eglDestroyContext 使用四.猜你喜欢 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES 基础 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES 特效 …目录
一. EGL 前言二. EGL 绘制流程简介三.eglDestroyContext 函数简介 四.eglDestroyContext 使用四.猜你喜欢 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES 基础 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES 特效 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES 转场 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES 函数 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES GPUImage 使用 零基础 OpenGL ES 学习路线推荐 : OpenGL ES 学习目录 OpenGL ES GLSL 编程 一. EGL 前言 EGLNativeDisplayType – 系统显示类型标识你所开发设备的物理屏幕DX/OPenGL ES/Metal/Vulkan…. EGLNativeWindowType – 系统窗口渲染显示的窗口句柄 EGLDisplay – 关联 EGLNativeDisplayType 系统物理屏幕的通用数据类型是平台上 WGL / GLX / AGL 的等价物 EGLSurface – 渲染区域相当于 OpenGL ES 绘图的画布 一块内存空间用户想绘制的信息首先都要先绘制到 EGLSurface 上然后通过 EGLDisplay 显示 EGLConfig – 对 EGLSurface 的 EGL 配置可以理解为绘制目标 framebuffer 的配置属性 EGLContext – OpenGL ES 图形上下文 二. EGL 绘制流程简介
获取 EGL Display 对象eglGetDisplay初始化与 EGLDisplay 之间的连接eglInitialize获取 EGLConfig 对象eglChooseConfig / eglGetConfigs创建 EGLContext 实例eglCreateContext创建 EGLSurface 实例eglCreateWindowSurface / eglCreatePbufferSurface连接 EGLContext 和 EGLSurface 上下文 eglMakeCurrent使用 OpenGL ES API 绘制图形gl_*切换 front buffer 和 back buffer 显示eglSwapBuffer断开并释放与 EGLSurface 关联的 EGLContext 对象eglRelease删除 EGLSurface 对象 eglDestroySurface删除 EGLContext 对象 eglDestroyContext终止与 EGLDisplay 之间的连接 三.eglDestroyContext 函数简介
eglDestroyContext 用于销毁渲染 Context 上下文如果有其它线程使用这个 Context 上下文时就要等到不使用时再销毁否则立即销毁
/*描述用于销毁渲染 EGLContext*参数* display指定显示的连接* contextEGLContext 上下文**返回值成功是返回 EGL_TRUE失败时返回 EGL_FALSE*/EGLAPI EGLBoolean eglDestroyContext(EGLDisplay display,EGLContext context);可能返回错误
EGL_FALSE is returned if destruction of the context fails, EGL_TRUE otherwise.EGL_BAD_DISPLAY is generated if display is not an EGL display connection.EGL_NOT_INITIALIZED is generated if display has not been initialized.EGL_BAD_CONTEXT is generated if context is not an EGL rendering context.在使用 eglDestroyContext 摧毁上下文之前一定要记得通过 eglMakeCurrent 绑定当前上下文 四.eglDestroyContext 使用
/******************************************************************************************/
//Author:猿说编程
//Blog(个人博客地址): www.codersrc.com
//File:OpenGL ES EGL eglDestroyContext
//Time:2022/08/04 07:30
//Motto:不积跬步无以至千里不积小流无以成江海程序人生的精彩需要坚持不懈地积累
/******************************************************************************************/void egl_demo()
{EGLDisplay display eglGetDisplay ( EGL_DEFAULT_DISPLAY );eglInitialize ( display , 0, 0);EGLConfig config;eglChooseConfig ( display , attribs , config , 1, numConfigs );EGLSurface surface eglCreateWindowSurface ( display , config , ANativeWindow , NULL );EGLContext context eglCreateContext ( display , config , NULL , NULL );eglMakeCurrent ( display , surface , surface , context )while(true){//opengl绘制glxx();eglSwapBuffers ( display , surface );}eglDestroyContext ( display , context );eglDestroySurface ( display , surface );eglTerminate ( display );
}四.猜你喜欢
OpenGL ES 简介OpenGL ES 版本介绍OpenGL ES 2.0 和 3.0 区别OpenGL ES 名词解释(一)OpenGL ES 名词解释(二)OpenGL ES GLSL 着色器使用过程OpenGL ES EGL 简介OpenGL ES EGL 名词解释OpenGL ES EGL eglGetDisplayOpenGL ES EGL eglInitializeOpenGL ES EGL eglGetConfigsOpenGL ES EGL eglChooseConfigOpenGL ES EGL eglGetErrorOpenGL ES EGL eglCreateContextOpenGL ES EGL eglCreateWindowSurfaceOpenGL ES EGL eglCreatePbufferSurfaceOpenGL ES EGL eglMakeCurrentOpenGL ES EGL eglSwapBufferOpenGL ES EGL eglDestroySurfaceOpenGL ES EGL eglDestroyContext