GLSL 向 C 引入了哪些关键字?
那么我们在C中:
auto if break int case long char register
continue return default short do sizeof
double static else struct entry switch extern
typedef float union for unsigned
goto while enum void const signed volatile
OpenGL (ES) Shader Language为我们提供了哪些新关键字?
我是 GLSL 新手,我想创建一些突出显示编辑实用程序以方便使用。
GLSL 中包含的数学单词将被视为关键字..?
So we have in C:
auto if break int case long char register
continue return default short do sizeof
double static else struct entry switch extern
typedef float union for unsigned
goto while enum void const signed volatile
What new keywords OpenGL (ES) Shader Language provide to us?
I am new to GLSL and I want to create some highlight editing util for ease of use.
Math words included into GLSL will count as keywords..?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
根据 最新规范的新规范(不包括上面列出的规范)文档:
保留供将来使用(此时会导致错误):
New ones (excluding the ones you listed above) according to the latest spec document:
Reserved for future use (will cause error at the moment):
您可能想要获取 OpenGL ES GLSL 语言规范 。 §3.6 列出了关键字(加上一些不是关键字的保留字,但无论如何你都不应该使用它们,所以它们可能也值得某种颜色编码)。
编辑:哎呀,我抓住了错误的链接。我很抱歉。当前规范为:
OpenGL 4.1 GLSL
OpenGL ES 2.0 GLSL
You probably want to get the OpenGL ES GLSL language specification. §3.6 lists the keywords (plus a number of reserved words that aren't keywords, but you're not supposed to use anyway, so they probably merit some sort of color coding as well).
Edit: Oops, I grabbed the wrong link there. My apologies. The current specs are:
OpenGL 4.1 GLSL
OpenGL ES 2.0 GLSL
除了上述答案之外,还有保留的标识符,例如。在 GLSL ES 3.0 规范 中:
除此之外的其他内容也被保留:
它与语法着色和正确性检查相关。
同样,以
GL_
开头的宏,以及一堆以__
开头的东西。Besides the above answers, there are also reserved identifiers, eg. in GLSL ES 3.0 spec:
And other things beyond these are reserved:
It is relevant for syntax coloring and correctness checking.
Similarly, macros starting with
GL_
, and a bunch of things with__
.