简单的OpenGL图像库(SOIL)使用不推荐使用的功能吗? [英] Simple OpenGL Image Library (SOIL) Uses deprecated functionality?

查看:409
本文介绍了简单的OpenGL图像库(SOIL)使用不推荐使用的功能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

本教程针对

尽管SOIL包括从图像自动创建纹理的功能,但它使用的功能在现代OpenGL中不可用.因此,我们将简单地将SOIL用作图像加载器并自己创建纹理.

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.

可以,但是有什么功能?库中还有哪些其他功能受到类似的影响?我有一个谷歌,但没有打开任何有关此的信息.我已经看到它在opengl es应用程序中也使用过,而IIRC仅具有核心opengl功能.

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.

在座的任何人都可以对所有功能是否可疑或仅仅是load_ogl_texture有所了解.

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

推荐答案

我非常确定问题是在调用'glGetString(GL_EXTENSIONS)',该问题已在OpenGL 3.0中弃用,并已在核心配置文件3.1中删除.正确的方法是(来自OpenGL论坛):

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);
}

这篇关于简单的OpenGL图像库(SOIL)使用不推荐使用的功能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆