diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-10 18:07:22 +0000 |
commit | c04dcc2e7d834218ef2d4194331e383402495ae1 (patch) | |
tree | 7333e38d10d75386e60f336b80c2443c1166031d /xbmc/guilib/GUIFontTTFGL.h | |
parent | Initial commit. (diff) | |
download | kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip |
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'xbmc/guilib/GUIFontTTFGL.h')
-rw-r--r-- | xbmc/guilib/GUIFontTTFGL.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/xbmc/guilib/GUIFontTTFGL.h b/xbmc/guilib/GUIFontTTFGL.h new file mode 100644 index 0000000..22fbe64 --- /dev/null +++ b/xbmc/guilib/GUIFontTTFGL.h @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2005-2018 Team Kodi + * This file is part of Kodi - https://kodi.tv + * + * SPDX-License-Identifier: GPL-2.0-or-later + * See LICENSES/README.md for more information. + */ + +#pragma once + +#include "GUIFontTTF.h" + +#include <string> +#include <vector> + +#include "system_gl.h" + +class CGUIFontTTFGL : public CGUIFontTTF +{ +public: + explicit CGUIFontTTFGL(const std::string& fontIdent); + ~CGUIFontTTFGL(void) override; + + bool FirstBegin() override; + void LastEnd() override; + + CVertexBuffer CreateVertexBuffer(const std::vector<SVertex>& vertices) const override; + void DestroyVertexBuffer(CVertexBuffer& bufferHandle) const override; + static void CreateStaticVertexBuffers(void); + static void DestroyStaticVertexBuffers(void); + +protected: + std::unique_ptr<CTexture> ReallocTexture(unsigned int& newHeight) override; + bool CopyCharToTexture(FT_BitmapGlyph bitGlyph, + unsigned int x1, + unsigned int y1, + unsigned int x2, + unsigned int y2) override; + void DeleteHardwareTexture() override; + + static GLuint m_elementArrayHandle; + +private: + unsigned int m_updateY1{0}; + unsigned int m_updateY2{0}; + + enum TextureStatus + { + TEXTURE_VOID = 0, + TEXTURE_READY, + TEXTURE_REALLOCATED, + TEXTURE_UPDATED, + }; + + TextureStatus m_textureStatus{TEXTURE_VOID}; + + static bool m_staticVertexBufferCreated; +}; |