网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

OpenGL ES EGL eglDestroyContext

目录

公司主营业务:网站制作、网站设计、移动网站开发等业务。帮助企业客户真正实现互联网宣传,提高企业的竞争能力。创新互联是一支青春激扬、勤奋敬业、活力青春激扬、勤奋敬业、活力澎湃、和谐高效的团队。公司秉承以“开放、自由、严谨、自律”为核心的企业文化,感谢他们对我们的高要求,感谢他们从不同领域给我们带来的挑战,让我们激情的团队有机会用头脑与智慧不断的给客户带来惊喜。创新互联推出黑河免费做网站回馈大家。

  • 一. 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 绘制流程简介

  1. 获取 EGL Display 对象:eglGetDisplay
  2. 初始化与 EGLDisplay 之间的连接:eglInitialize
  3. 获取 EGLConfig 对象:eglChooseConfig / eglGetConfigs
  4. 创建 EGLContext 实例:eglCreateContext
  5. 创建 EGLSurface 实例:eglCreateWindowSurface / eglCreatePbufferSurface
  6. 连接 EGLContext 和 EGLSurface 上下文 eglMakeCurrent
  7. 使用 OpenGL ES API 绘制图形:gl_*
  8. 切换 front buffer 和 back buffer 显示:eglSwapBuffer
  9. 断开并释放与 EGLSurface 关联的 EGLContext 对象:eglRelease
  10. 删除 EGLSurface 对象 eglDestroySurface
  11. 删除 EGLContext 对象 eglDestroyContext
  12. 终止与 EGLDisplay 之间的连接

三.eglDestroyContext 函数简介

eglDestroyContext 用于销毁渲染 Context 上下文,如果有其它线程使用这个 Context 上下文时就要等到不使用时再销毁,否则立即销毁;

/*描述:用于销毁渲染 EGLContext
 *参数:
 *    display:指定显示的连接
 *    context:EGLContext 上下文
 *
 *返回值:成功是返回 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 );
}

四.猜你喜欢

  1. OpenGL ES 简介
  2. OpenGL ES 版本介绍
  3. OpenGL ES 2.0 和 3.0 区别
  4. OpenGL ES 名词解释(一)
  5. OpenGL ES 名词解释(二)
  6. OpenGL ES GLSL 着色器使用过程
  7. OpenGL ES EGL 简介
  8. OpenGL ES EGL 名词解释
  9. OpenGL ES EGL eglGetDisplay
  10. OpenGL ES EGL eglInitialize
  11. OpenGL ES EGL eglGetConfigs
  12. OpenGL ES EGL eglChooseConfig
  13. OpenGL ES EGL eglGetError
  14. OpenGL ES EGL eglCreateContext
  15. OpenGL ES EGL eglCreateWindowSurface
  16. OpenGL ES EGL eglCreatePbufferSurface
  17. OpenGL ES EGL eglMakeCurrent
  18. OpenGL ES EGL eglSwapBuffer
  19. OpenGL ES EGL eglDestroySurface
  20. OpenGL ES EGL eglDestroyContext

本文由博客 - 猿说编程 猿说编程 发布!


新闻标题:OpenGL ES EGL eglDestroyContext
当前地址:http://bjjierui.cn/article/dsoieoo.html

其他资讯