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.

81 lines
2.6 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef ISCHEMESURFACE_H
  8. #define ISCHEMESURFACE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "vgui_surfacelib/ifontsurface.h"
  13. #include "appframework/iappsystem.h"
  14. class IMaterial;
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Wraps functions that the scheme system needs access to.
  17. //-----------------------------------------------------------------------------
  18. abstract_class ISchemeSurface : public IAppSystem
  19. {
  20. public:
  21. virtual InitReturnVal_t Init() = 0;
  22. // creates an empty handle to a vgui font. windows fonts can be add to this via SetFontGlyphSet().
  23. virtual FontHandle_t CreateFont() = 0;
  24. virtual bool SetFontGlyphSet( FontHandle_t font, const char *windowsFontName, int tall, int weight,
  25. int blur, int scanlines, int flags, int nRangeMin = 0, int nRangeMax = 0) = 0;
  26. virtual const char *GetFontName( FontHandle_t font ) = 0;
  27. virtual int GetFontTall( FontHandle_t font ) = 0;
  28. virtual int GetCharacterWidth( FontHandle_t font, int ch ) = 0;
  29. virtual void GetCharABCwide( FontHandle_t font, int ch, int &a, int &b, int &c ) = 0;
  30. // Custom font support
  31. virtual bool AddCustomFontFile(const char *fontFileName) = 0;
  32. // Bitmap Font support
  33. virtual bool AddBitmapFontFile(const char *fontFileName) = 0;
  34. virtual void SetBitmapFontName( const char *pName, const char *pFontFilename ) = 0;
  35. virtual const char *GetBitmapFontName( const char *pName ) = 0;
  36. virtual bool SetBitmapFontGlyphSet( FontHandle_t font, const char *windowsFontName, float scalex,
  37. float scaley, int flags) = 0;
  38. virtual bool SupportsFontFeature( FontFeature_t feature ) = 0;
  39. virtual void GetScreenSize(int &wide, int &tall) = 0;
  40. // Gets the base resolution used in proportional mode
  41. virtual void GetProportionalBase( int &width, int &height ) = 0;
  42. // Functions used by game ui editor.
  43. virtual IMaterial *GetTextureForChar( FontCharRenderInfo &info, float **texCoords )
  44. {
  45. Assert(0);
  46. return NULL;
  47. }
  48. // Returns an array of the 4 render positions for the character.
  49. virtual bool GetUnicodeCharRenderPositions( FontCharRenderInfo& info, Vector2D *pPositions )
  50. {
  51. Assert(0);
  52. return false;
  53. }
  54. virtual IMaterial *GetMaterial( int textureId )
  55. {
  56. Assert(0);
  57. return NULL;
  58. }
  59. virtual void SetLanguage( const char *pLanguage ) = 0;
  60. virtual const char *GetLanguage() = 0;
  61. virtual void PrecacheFontCharacters( FontHandle_t font, wchar_t *pCharacters ) = 0;
  62. };
  63. #endif // ISCHEMESURFACE_H