Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.2 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef IFONTSURFACE_H
  8. #define IFONTSURFACE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "mathlib/vector2d.h" // must be before the namespace line
  13. #ifdef CreateFont
  14. #undef CreateFont
  15. #endif
  16. // returns true if the surface supports minimize & maximize capabilities
  17. // Numbered this way to prevent interface change in surface.
  18. enum FontFeature_t
  19. {
  20. FONT_FEATURE_ANTIALIASED_FONTS = 1,
  21. FONT_FEATURE_DROPSHADOW_FONTS = 2,
  22. FONT_FEATURE_OUTLINE_FONTS = 6,
  23. };
  24. // adds to the font
  25. enum FontFlags_t
  26. {
  27. FONTFLAG_NONE,
  28. FONTFLAG_ITALIC = 0x001,
  29. FONTFLAG_UNDERLINE = 0x002,
  30. FONTFLAG_STRIKEOUT = 0x004,
  31. FONTFLAG_SYMBOL = 0x008,
  32. FONTFLAG_ANTIALIAS = 0x010,
  33. FONTFLAG_GAUSSIANBLUR = 0x020,
  34. FONTFLAG_ROTARY = 0x040,
  35. FONTFLAG_DROPSHADOW = 0x080,
  36. FONTFLAG_ADDITIVE = 0x100,
  37. FONTFLAG_OUTLINE = 0x200,
  38. FONTFLAG_CUSTOM = 0x400, // custom generated font - never fall back to asian compatibility mode
  39. FONTFLAG_BITMAP = 0x800, // compiled bitmap font - no fallbacks
  40. };
  41. enum FontDrawType_t
  42. {
  43. // Use the "additive" value from the scheme file
  44. FONT_DRAW_DEFAULT = 0,
  45. // Overrides
  46. FONT_DRAW_NONADDITIVE,
  47. FONT_DRAW_ADDITIVE,
  48. FONT_DRAW_TYPE_COUNT = 2,
  49. };
  50. struct FontVertex_t
  51. {
  52. FontVertex_t() {}
  53. FontVertex_t( const Vector2D &pos, const Vector2D &coord = Vector2D( 0, 0 ) )
  54. {
  55. m_Position = pos;
  56. m_TexCoord = coord;
  57. }
  58. void Init( const Vector2D &pos, const Vector2D &coord = Vector2D( 0, 0 ) )
  59. {
  60. m_Position = pos;
  61. m_TexCoord = coord;
  62. }
  63. Vector2D m_Position;
  64. Vector2D m_TexCoord;
  65. };
  66. typedef unsigned long FontHandle_t;
  67. struct FontCharRenderInfo
  68. {
  69. // Text pos
  70. int x, y;
  71. // Top left and bottom right
  72. // This is now a pointer to an array maintained by the surface, to avoid copying the data on the 360
  73. FontVertex_t *verts;
  74. int textureId;
  75. int abcA;
  76. int abcB;
  77. int abcC;
  78. int fontTall;
  79. FontHandle_t currentFont;
  80. // In:
  81. FontDrawType_t drawType;
  82. wchar_t ch;
  83. // Out
  84. bool valid;
  85. // In/Out (true by default)
  86. bool shouldclip;
  87. };
  88. #endif // IFONTSURFACE_H