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 繪制流程簡介
三.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 ); }四.猜你喜歡
總結
以上是生活随笔為你收集整理的OpenGL ES EGL eglDestroyContext的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 禾穗HERS | 职场新人第一定律
- 下一篇: 使用基于ThinkPHP3.2.3的Th