问题描述
QOpenGLFunctions似乎缺少重要的功能,例如glInvalidateFramebuffer和glMapBuffer.据我了解,QOpenGLFunctions加载了桌面OpenGL函数和ES函数的交集.如果是这样,为什么不提供这两个功能?据我所知,glMapBuffer在这两者中.
QOpenGLFunctions seems to be missing important functions such as glInvalidateFramebuffer and glMapBuffer. From what I understand QOpenGLFunctions loads the intersection of both desktop OpenGL functions and ES functions. If that's the case, why aren't these two functions present? From what I can tell glMapBuffer is in both.
我误解了QOpenGLFunctions,还是它们实际上丢失了函数(不太可能)?
Am I misunderstanding QOpenGLFunctions, or are they actually missing functions(unlikely)?
推荐答案
这两种情况有多种原因,而注释中有一种:
There are multiple reasons for those two cases and the one in the comment:
1)据我所知,添加过程是选择性的.仅添加了那些您需要手动解决的功能.
在上述glDrawArrays
情况下,该功能已经存在了一段时间,无论是在台式机OpenGL还是支持Qt的ES中,都没有必要手动解决任何问题.
In the aforementioned glDrawArrays
case, that function have been available for a while, both in desktop OpenGL as well as ES where Qt is supported, so there is not much need to resolve anything there manually.
您可以立即使用常规的opengl方式使用它们,包括gl.h
等等.
You can just use them right away the regular opengl way, including gl.h
and all that.
2)目前, Qt不支持OpenGL ES 3 通过此界面.您前面提到的函数glMapBuffer
和glInvalidateFramebuffer
可能属于此类.默认情况下,它们在OpenGL ES 2中不可用.
2) For the time being, Qt does not support OpenGL ES 3 through this interface. Your aforementioned functions, glMapBuffer
and glInvalidateFramebuffer
are likely to fall into this category. They are not available in OpenGL ES 2 "by default".
如果有任何功能由于上述原因未公开或未涵盖,则可能被忽略了.
If there is any function not being exposed and not covered by the aforementioned reasons, it is likely to be an overlook or so.
这篇关于QOpenGLFunctions缺少重要的OpenGL函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!