kodi
GUIFontTTFGLES.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "GUIFontTTF.h"
12 
13 #include <string>
14 #include <vector>
15 
16 #include "system_gl.h"
17 
19 {
20 public:
21  explicit CGUIFontTTFGLES(const std::string& fontIdent);
22  ~CGUIFontTTFGLES(void) override;
23 
24  bool FirstBegin() override;
25  void LastEnd() override;
26 
27  CVertexBuffer CreateVertexBuffer(const std::vector<SVertex>& vertices) const override;
28  void DestroyVertexBuffer(CVertexBuffer& bufferHandle) const override;
29  static void CreateStaticVertexBuffers(void);
30  static void DestroyStaticVertexBuffers(void);
31 
32 protected:
33  std::unique_ptr<CTexture> ReallocTexture(unsigned int& newHeight) override;
34  bool CopyCharToTexture(FT_BitmapGlyph bitGlyph,
35  unsigned int x1,
36  unsigned int y1,
37  unsigned int x2,
38  unsigned int y2) override;
39  void DeleteHardwareTexture() override;
40 
41  static GLuint m_elementArrayHandle;
42 
43 private:
44  unsigned int m_updateY1{0};
45  unsigned int m_updateY2{0};
46 
47  enum TextureStatus
48  {
49  TEXTURE_VOID = 0,
50  TEXTURE_READY,
51  TEXTURE_REALLOCATED,
52  TEXTURE_UPDATED,
53  };
54 
55  TextureStatus m_textureStatus{TEXTURE_VOID};
56 
57  static bool m_staticVertexBufferCreated;
58 };
Definition: GUIFontTTF.h:76
Definition: GUIFontCache.h:220
Definition: GUIFontTTFGLES.h:18