documentation对于错误回调函数状态:
Each time a debug message is generated the debug callback function will be invoked with
source
,type
,id
, andseverity
associated with the message, andlength
set to the length of debug message whose character string is in the array pointed to bymessage
.userParam
will be set to the value passed in theuserParam
parameter to the most recent call toglDebugMessageCallback
.
源是指枚举器文档中解释的源类型。
Type是指触发回调的事件类型。
Severity是指错误的严重程度。
长度是消息字符串的字节大小。
Message是指向消息字符串的指针。
UserParam 是用户定义的一些指针,可以是函数、结构、null、内存映射外设...
身份证到底是什么?违规对象? (着色器、程序、纹理)
窗口ID?当前 OpenGL 上下文的 id?
最佳答案
调试输出中的所有 OpenGL 错误都有一个 ID。这与消息类型和严重性一起用于识别特定错误。对于系统生成的错误,ID 是实现定义的。但是,如果错误来自 standard OpenGL error ,那么它通常是枚举器错误类别(GL_INVALID_ENUM
、GL_INVALID_OPERATION
等)。用户创建的消息可以有自己的 ID。
ID 的作用是能够识别特定的错误消息,从而允许您使用 glDebugMessageControl
等接口(interface)来剔除该特定错误。
关于c++ - OpenGL调试错误回调函数的ID参数是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49895263/