十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
目录
站在用户的角度思考问题,与客户深入沟通,找到鄄城网站设计与鄄城网站推广的解决方案,凭借多年的经验,让设计与互联网技术结合,创造个性化、用户体验好的作品,建站类型包括:成都做网站、成都网站建设、成都外贸网站建设、企业官网、英文网站、手机端网站、网站推广、域名申请、虚拟空间、企业邮箱。业务覆盖鄄城地区。
零基础 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 编程
EGLNativeDisplayType – 系统显示类型,标识你所开发设备的物理屏幕,DX/OPenGL ES/Metal/Vulkan….
EGLNativeWindowType – 系统窗口,渲染显示的窗口句柄
EGLDisplay – 关联 EGLNativeDisplayType 系统物理屏幕的通用数据类型,是平台上 WGL / GLX / AGL 的等价物
EGLSurface – 渲染区域,相当于 OpenGL ES 绘图的画布 (一块内存空间),用户想绘制的信息首先都要先绘制到 EGLSurface 上,然后通过 EGLDisplay 显示
EGLConfig – 对 EGLSurface 的 EGL 配置,可以理解为绘制目标 framebuffer 的配置属性
EGLContext – OpenGL ES 图形上下文
eglQueryContext 用于查询渲染上下文相关信息,函数声明如下:
/*描述:用于查询渲染上下文相关信息
*参数:
* display:指定显示的连接
* context:EGLContext 上下文
* attribute:查询渲染上下文相关信息 EGL_CONFIG_ID、EGL_CONTEXT_CLIENT_TYPE、EGL_CONTEXT_CLIENT_VERSION
* value:(输出参数)返回查询结果
*返回值:成功是返回 EGL_TRUE,失败时返回 EGL_FALSE
*/
EGLBoolean eglQueryContext( EGLDisplay display,
EGLContext context,
EGLint attribute,
EGLint * value);
attribute 可以为下面值:
EGL_CONFIG_ID
Returns the ID of the EGL frame buffer configuration with respect to which the context was created.
EGL_CONTEXT_CLIENT_TYPE
Returns the type of client API which the context supports (one of EGL_OPENGL_API, EGL_OPENGL_ES_API, or EGL_OPENVG_API).
EGL_CONTEXT_CLIENT_VERSION
Returns the version of the client API which the context supports, as specified at context creation time. The resulting value is only meaningful for an OpenGL ES context.
EGL_RENDER_BUFFER
Returns the buffer which client API rendering via the context will use. The value returned depends on properties of both the context, and the surface to which the context is bound:
If the context is bound to a pixmap surface, then EGL_SINGLE_BUFFER will be returned.
If the context is bound to a pbuffer surface, then EGL_BACK_BUFFER will be returned.
If the context is bound to a window surface, then either EGL_BACK_BUFFER or EGL_SINGLE_BUFFER may be returned. The value returned depends on both the buffer requested by the setting of the EGL_RENDER_BUFFER property of the surface (which may be queried by calling eglQuerySurface), and on the client API (not all client APIs support single-buffer rendering to window surfaces).
If the context is not bound to a surface, such as an OpenGL ES context bound to a framebuffer object, then EGL_NONE will be returned.
Notes
Attributes EGL_CONTEXT_CLIENT_TYPE and EGL_RENDER_BUFFER are supported only if the EGL version is 1.2 or greater.
Attribute EGL_CONTEXT_CLIENT_VERSION is supported only if the EGL version is 1.3 or greater.
可能返回错误:
EGL_FALSE is returned on failure, EGL_TRUE otherwise. value is not modified when EGL_FALSE is returned.
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.
EGL_BAD_ATTRIBUTE is generated if attribute is not a valid context attribute.
类似 eglDestroyContext 摧毁上下文一样 ,eglQueryContext** 使用**之前一定要记得通过 eglMakeCurrent 绑定当前上下文;
/******************************************************************************************/
//@Author:猿说编程
//@Blog(个人博客地址): www.codersrc.com
//@File:OpenGL ES EGL eglQueryContext
//@Time:2022/08/04 07:30
//@Motto:不积跬步无以至千里,不积小流无以成江海,程序人生的精彩需要坚持不懈地积累!
/******************************************************************************************/
//创建上下文
EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 3, EGL_NONE };
EGLContext context = eglCreateContext ( display , config , EGL_NO_CONTEXT, contextAttribs );
//绑定上下文
eglMakeCurrent ( display , surface , surface , context )
//查询 OpenGL 版本
int clientVersion;
eglQueryContext(m_eglDisplay, m_eglContext, EGL_CONTEXT_CLIENT_VERSION, &clientVersion);
//clientVersion = 3
printf("EGLContext created, client version %d\n", clientVersion);
//摧毁上下文
eglDestroyContext ( display , context );
eglDestroySurface ( display , surface );
eglTerminate ( display );
本文由博客 - 猿说编程 猿说编程 发布!