目錄
創(chuàng)新互聯(lián)主要從事網(wǎng)站設(shè)計制作、成都做網(wǎng)站、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)來賓,10年網(wǎng)站建設(shè)經(jīng)驗(yàn),價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):18982081108
零基礎(chǔ) OpenGL ES 學(xué)習(xí)路線推薦 : OpenGL ES 學(xué)習(xí)目錄 >> OpenGL ES 基礎(chǔ)
零基礎(chǔ) OpenGL ES 學(xué)習(xí)路線推薦 : OpenGL ES 學(xué)習(xí)目錄 >> OpenGL ES 特效
零基礎(chǔ) OpenGL ES 學(xué)習(xí)路線推薦 : OpenGL ES 學(xué)習(xí)目錄 >> OpenGL ES 轉(zhuǎn)場
零基礎(chǔ) OpenGL ES 學(xué)習(xí)路線推薦 : OpenGL ES 學(xué)習(xí)目錄 >> OpenGL ES 函數(shù)
零基礎(chǔ) OpenGL ES 學(xué)習(xí)路線推薦 : OpenGL ES 學(xué)習(xí)目錄 >> OpenGL ES GPUImage 使用
零基礎(chǔ) OpenGL ES 學(xué)習(xí)路線推薦 : OpenGL ES 學(xué)習(xí)目錄 >> OpenGL ES GLSL 編程
EGLNativeDisplayType – 系統(tǒng)顯示類型,標(biāo)識你所開發(fā)設(shè)備的物理屏幕,DX/OPenGL ES/Metal/Vulkan….
EGLNativeWindowType – 系統(tǒng)窗口,渲染顯示的窗口句柄
EGLDisplay – 關(guān)聯(lián) EGLNativeDisplayType 系統(tǒng)物理屏幕的通用數(shù)據(jù)類型,是平臺上 WGL / GLX / AGL 的等價物
EGLSurface – 渲染區(qū)域,系統(tǒng)窗口或 frame buffer 句柄 ,可以理解為一個后端的渲染目標(biāo)窗口
EGLConfig – 對 EGLSurface 的 EGL 配置,可以理解為繪制目標(biāo) framebuffer 的配置屬性
EGLContext – OpenGL ES 圖形上下文
EGL 中大部分函數(shù)成功時都是返回 EGL_TRUE,失敗返回 EGL_FALSE。至于其他錯誤原因,需要調(diào)用 eglGetError 函數(shù)獲取:
// 描述:返回 EGL 錯誤號,如果返回 EGL_SUCCESS 說明沒有錯誤
EGLint eglGetError();
調(diào)用 eglGetError 如果返回 EGL_SUCCESS 說明沒有錯誤,返回其他值表示有錯誤產(chǎn)生;例如 :eglInitialize 會初始化 EGL 內(nèi)部數(shù)據(jù),分配顯存等初始化失敗
/******************************************************************************************/
//@Author:猿說編程
//@Blog(個人博客地址): www.codersrc.com
//@File:OpenGL ES EGL eglGetError
//@Time:2022/08/04 07:30
//@Motto:不積跬步無以至千里,不積小流無以成江海,程序人生的精彩需要堅持不懈地積累!
/******************************************************************************************/
EGLint attrs[3] = { EGL_DEPTH_SIZE, 16, EGL_NONE };
EGLint num_configs;
EGLConfigs *configs_list;
// Get the display device
if ((eglDisplay = eglGetDisplay(EGL_NO_DISPLAY)) == EGL_NO_DISPLAY) {
return eglGetError();
}
// Initialize the display
if (eglInitialize(eglDisplay, NULL, NULL) == EGL_FALSE) {
return eglGetError();
}
// Obtain the total number of configurations that match
if (eglChooseConfig(eglDisplay, attrs, NULL, 0, &num_configs) == EGL_FALSE) {
return eglGetError();
}
configs_list = malloc(num_configs * sizeof(EGLConfig));
if (configs_list == (EGLConfig *)0){
return eglGetError();
}
// Obtain the first configuration with a depth buffer of 16 bits
if (!eglChooseConfig(eglDisplay, attrs, &configs_list, num_configs, &num_configs)) {
return eglGetError();
}
本文由博客 - 猿說編程 猿說編程 發(fā)布!
當(dāng)前標(biāo)題:OpenGL ES EGL eglGetError
文章來源:http://chinadenli.net/article22/dsoiecc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號、用戶體驗(yàn)、網(wǎng)站策劃、小程序開發(fā)、網(wǎng)站維護(hù)、軟件開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)