是否可以在用 glBitmap 绘制的位图上使用 glScalef?

Is it possible to use glScalef on a bitmap that is drawn with glBitmap?

我正在制作一个使用 FreeType 2 和旧版 OpenGL 的文本渲染器。问题是,FreeType 2 的坐标系在左上角有 (0, 0),而 OpenGL 的坐标系是笛卡尔坐标系。这意味着我必须翻转位图。我希望 glScalef 可以与 glBitmap 一起使用,但它没有效果。谁能告诉我是否可以使用 glScalef 垂直翻转位图,或者如果不可能,请告诉我其他可以翻转位图的来源(最好尽可能高效)?

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glScalef(1.0, -1.0, 1.0)
glBitmap(size_x, size_y, 0, 0, xadd, yadd, (GLubyte *) bitmap);

您要查找的函数是glPixelZoom

Pixel zoom factors are not limited to positive values. Negative zoom factors reflect the resulting image about the current raster position.

它肯定会对 glDrawPixels 产生预期的效果。 glBitmap 中有一条注释说它的行为类似于 glDrawPixels 但我找不到任何关于 glPixelZoom 是否适用于 glBitmap 的明确声明,所以 YMMV.