glGetString(GL_EXTENSIONS)导致crash

"glGetString() is not deprecated, only the GL_EXTENSIONS argument to it is. There’s a lot of history with people using fixed-size buffers to copy the merged extension string into and having that break when someone releases a new driver, which is what we’re hoping to alleviate in the long term here."

可以使用

GLint n, i;
glGetIntegerv(GL_NUM_EXTENSIONS, &n);
for (i = 0; i < n; i++) {
    printf("%s", glGetStringi(GL_EXTENSIONS, i));
}

 

参考https://community.khronos.org/t/gl-extensions-replacement/55542

posted @ 2019-09-16 21:17  redips  阅读(1262)  评论(0编辑  收藏  举报