glGetString和glGetShaderInfoLog等函数使用什么编码 [英] What encoding is used by functions such as glGetString and glGetShaderInfoLog
问题描述
OpenGL具有一些返回字符串的函数,例如glGetString
和glGetShaderInfoLog
.这些使用哪种形式的文本编码?
OpenGL has a few functions like glGetString
and glGetShaderInfoLog
that return strings. What form of text encoding is used for these?
我假设,假设它们以GLchar*
的形式返回,则返回值中包含的是ASCII编码的文本,但这是否在任何地方指定了?
I assume, given that they're returned as a GLchar*
, that it is ASCII encoded text contained in the return value but is this specified anywhere?
第二个相关的问题是,诸如glShaderSource
和glBindAttribLocation
之类的功能需要什么样的文本编码. GLSL程序是否必须用ASCII编码或可以是UTF-8?
As a second and related point, what text encoding is expected by functions such as glShaderSource
and glBindAttribLocation
. Do GLSL programs have to be encoded in ASCII or can it be UTF-8?
推荐答案
OpenGL 4.3兼容性配置文件规范,第22.2节,第627页:
OpenGL 4.3 Compatibility Profile Specification, section 22.2, page 627:
字符串查询返回指向UTF-8编码,以空值结尾的静态字符串的指针,这些字符串描述了当前GL上下文的属性.
String queries return pointers to UTF-8 encoded, null-terminated static strings describing properties of the current GL context.
据我所知,规范中并未提及glGetShaderInfoLog()
的编码.
As far as I can see the spec doesn't mention the encoding of glGetShaderInfoLog()
.
这篇关于glGetString和glGetShaderInfoLog等函数使用什么编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!