Simple OpenGL Image Library (SOIL) Uses deprecated functionality?

我的梦境 提交于 2019-12-13 14:08:09

问题


This tutorial states the following regarding the SOIL library:

Although SOIL includes functions to automatically create a texture from an image, it uses features that aren't available in modern OpenGL. Because of this we'll simply use SOIL as image loader and create the texture ourselves.

That's OK, but what functionality? And what other functions from the library are similarly affected? I have had a google but not turned up any info on this. I have seen it used in opengl es apps also which IIRC only has the core opengl functionality.

Can anyone here shine any light on whether all functions are suspect or if it is just load_ogl_texture.


回答1:


I'm pretty sure the problem is calling 'glGetString(GL_EXTENSIONS)' which has been deprecated in OpenGL 3.0 and removed in core profile 3.1. The correct approach is to (From OpenGL Forum):

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


来源:https://stackoverflow.com/questions/17923782/simple-opengl-image-library-soil-uses-deprecated-functionality

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!