问题
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