浏览代码

Note GL blend state for stb_truetype

Jan CW Kroeze 4 年之前
父节点
当前提交
04007a071c
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      stb_truetype.h

+ 2 - 0
stb_truetype.h

@@ -297,6 +297,8 @@ void my_stbtt_initfont(void)
 void my_stbtt_print(float x, float y, char *text)
 {
    // assume orthographic projection with units = screen pixels, origin at top left
+   glEnable(GL_BLEND);
+   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnable(GL_TEXTURE_2D);
    glBindTexture(GL_TEXTURE_2D, ftex);
    glBegin(GL_QUADS);