2

我正在使用 HarfBuzz 和 freetype 来呈现区域语言印地语。

如果我为创建窗口编写这三个选项,则字体不会呈现,我只会看到空白屏幕。

glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);

如果没有这三个选项,字体将正确呈现。

我很想知道这些选项在创建窗口时有何不同?

4

1 回答 1

3

That is because you create a core profile OpenGL Context (GLFW_OPENGL_CORE_PROFILE).
In compare to a compatibility profile context (GLFW_OPENGL_COMPAT_PROFILE), which is default, Legacy OpenGL OpenGL instructions are not valid and cause OpenGL errors.

The main difference is, that you can't use glBegin/glEnd sequences, fixed function attributes (e.g. glVertexPointer) respectively client-side capability or the current matrix stack.
If you want to draw geometry, then you've to create Vertex Array Objects and to use Shader programs.

The complete differences can be seen in the OpenGL 3.3 Compatibility Profile specification or for the most recent OpenGL version OpenGL 4.6 API Compatibility Profile Specification, where the functionality that is only in the compatibility profile specification and not in the core specification is typeset in orange.

于 2019-11-18T06:31:12.990 回答