Merge pull request #22816 from CastagnaIT/fix_tx3g
[xbmc.git] / xbmc / guilib / GUITextureGL.h
blob4acba1eb6dedfa8d25006fd9e441096c47258cef
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>
16 #include "system_gl.h"
18 class CRenderSystemGL;
20 class CGUITextureGL : public CGUITexture
22 public:
23 static void Register();
24 static CGUITexture* CreateTexture(
25 float posX, float posY, float width, float height, const CTextureInfo& texture);
27 static void DrawQuad(const CRect& coords,
28 UTILS::COLOR::Color color,
29 CTexture* texture = nullptr,
30 const CRect* texCoords = nullptr);
32 CGUITextureGL(float posX, float posY, float width, float height, const CTextureInfo& texture);
33 ~CGUITextureGL() override = default;
35 CGUITextureGL* Clone() const override;
37 protected:
38 void Begin(UTILS::COLOR::Color color) override;
39 void Draw(float *x, float *y, float *z, const CRect &texture, const CRect &diffuse, int orientation) override;
40 void End() override;
42 private:
43 CGUITextureGL(const CGUITextureGL& texture) = default;
45 std::array<GLubyte, 4> m_col;
47 struct PackedVertex
49 float x, y, z;
50 float u1, v1;
51 float u2, v2;
54 std::vector<PackedVertex> m_packedVertices;
55 std::vector<GLushort> m_idx;
56 CRenderSystemGL *m_renderSystem;