
简单说明两点:
- eglGetError是全程调用API时,若调用失败,用来获取失败原因的,所以单独列出。
- eglChooseConfig是让EGL自动帮你选择合适的配置,结果往往跟手动调用eglGetConfigs和eglGetConfigAttrib得到的结果相同,下面的代码就是使用eglChooseConfig。
例程:
// esCreateWindow()
//
// title - name for title bar of window
// width - width of window to create
// height - height of window to create
// flags - bitwise or of window creation flags
// ES_WINDOW_ALPHA - specifies that the framebuffer should have alpha
// ES_WINDOW_DEPTH - specifies that a depth buffer should be created
// ES_WINDOW_STENCIL - specifies that a stencil buffer should be created
// ES_WINDOW_MULTISAMPLE - specifies that a multi-sample buffer should be created
//
GLboolean ESUTIL_API esCreateWindow ( ESContext *esContext, const char *title, GLint width, GLint height

本文介绍了在OpenGL ES3.0中如何利用EGL创建渲染表面和上下文的过程,强调了eglGetError在错误检查中的作用,以及eglChooseConfig在自动选择合适配置的功能。示例代码展示了具体的实现步骤。

5877

被折叠的 条评论
为什么被折叠?



