FONT.H
Upload User: nthssl
Upload Date: 2022-04-05
Package Size: 25357k
Code Size: 1k
Category:

OpenCV

Development Platform:

Visual C++

  1. #ifndef __FONT_H
  2. #define __FONT_H
  3. #include <windows.h>
  4. #include <gl/gl.h>
  5. #include <gl/glu.h>
  6. class CFont
  7. {
  8. private:
  9. unsigned int texID; // 字体的纹理id
  10. unsigned int callList; // 字体显示列表
  11. float r, g, b, a; // RGBA值
  12. int screenX, screenY; // 屏幕坐标
  13. float xpos, ypos, zpos; // 三维坐标
  14. void LoadTexture(); // 装入TGA字体纹理
  15. void CreateCallLists(); // 创建字体显示列表
  16. public:
  17. CFont();
  18. CFont(char *name, int size);
  19. ~CFont();
  20. void Build(char *name, int size);
  21. void ClearFont();
  22. void Print(const char *str, ...);
  23. void SetPos2D(int x, int y) { screenX = x; screenY = y; }
  24. void SetPos3D(float x, float y, float z) { xpos = x; ypos = y; zpos = z; }
  25. void SetRGB(float red, float green, float blue) { r = red; g = green; b = blue; a = 1.0; }
  26. void SetRGBA(float red, float green, float blue, float alpha) { r = red; g = green; b = blue; a = alpha; }
  27. };
  28. #endif