gpt4 book ai didi

c++ - OpenGL:glGetError()是否不重置其标志?

转载 作者:行者123 更新时间:2023-12-02 10:03:14 36 4
gpt4 key购买 nike

我正在尝试使用glGetError()调试代码,但我注意到每次调用它都会引发错误1282。最终,我连续两行调用glGetError(),两者都给出了错误1282。

它应该在第一次调用后重置错误标志,导致第二次返回0吗?还是此功能与我想象的不同?

最佳答案

it'直到干燥:

To allow for distributed implementations, there may be several error flags. If any single error flag has recorded an error, the value of that flag is returned and that flag is reset to GL_NO_ERROR when glGetError is called. If more than one flag has recorded an error, glGetError returns and clears an arbitrary error flag value. Thus, glGetError should always be called in a loop, until it returns GL_NO_ERROR, if all error flags are to be reset.

关于c++ - OpenGL:glGetError()是否不重置其标志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61513280/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com