Merge pull request #22816 from CastagnaIT/fix_tx3g
[xbmc.git] / xbmc / guilib / GUITextureGLES.h
bloba9b361031b1cdd898c4d9d4a7257289c467eb86d
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "GUITexture.h"
12 #include "utils/ColorUtils.h"
14 #include <array>
15 #include <vector>
17 #include "system_gl.h"
19 struct PackedVertex
21 float x, y, z;
22 float u1, v1;
23 float u2, v2;
25 typedef std::vector<PackedVertex> PackedVertices;
27 class CRenderSystemGLES;
29 class CGUITextureGLES : public CGUITexture
31 public:
32 static void Register();
33 static CGUITexture* CreateTexture(
34 float posX, float posY, float width, float height, const CTextureInfo& texture);
36 static void DrawQuad(const CRect& coords,
37 UTILS::COLOR::Color color,
38 CTexture* texture = nullptr,
39 const CRect* texCoords = nullptr);
41 CGUITextureGLES(float posX, float posY, float width, float height, const CTextureInfo& texture);
42 ~CGUITextureGLES() override = default;
44 CGUITextureGLES* Clone() const override;
46 protected:
47 void Begin(UTILS::COLOR::Color color) override;
48 void Draw(float* x, float* y, float* z, const CRect& texture, const CRect& diffuse, int orientation) override;
49 void End() override;
51 private:
52 CGUITextureGLES(const CGUITextureGLES& texture) = default;
54 std::array<GLubyte, 4> m_col;
56 PackedVertices m_packedVertices;
57 std::vector<GLushort> m_idx;
58 CRenderSystemGLES *m_renderSystem;