kodi
GUITextureGL.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 "GUITexture.h"
12 #include "utils/ColorUtils.h"
13 
14 #include <array>
15 
16 #include "system_gl.h"
17 
18 class CRenderSystemGL;
19 
20 class CGUITextureGL : public CGUITexture
21 {
22 public:
23  static void Register();
24  static CGUITexture* CreateTexture(
25  float posX, float posY, float width, float height, const CTextureInfo& texture);
26 
27  static void DrawQuad(const CRect& coords,
28  UTILS::COLOR::Color color,
29  CTexture* texture = nullptr,
30  const CRect* texCoords = nullptr);
31 
32  CGUITextureGL(float posX, float posY, float width, float height, const CTextureInfo& texture);
33  ~CGUITextureGL() override = default;
34 
35  CGUITextureGL* Clone() const override;
36 
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;
41 
42 private:
43  CGUITextureGL(const CGUITextureGL& texture) = default;
44 
45  std::array<GLubyte, 4> m_col;
46 
47  struct PackedVertex
48  {
49  float x, y, z;
50  float u1, v1;
51  float u2, v2;
52  };
53 
54  std::vector<PackedVertex> m_packedVertices;
55  std::vector<GLushort> m_idx;
56  CRenderSystemGL *m_renderSystem;
57 };
58 
Definition: RenderSystemGL.h:66
Base texture class, subclasses of which depend on the render spec (DX, GL etc.)
Definition: Texture.h:34
Definition: GUITexture.h:51
Definition: GUITexture.h:73
void Begin(UTILS::COLOR::Color color) override
called after our textures have been freed
Definition: GUITextureGL.cpp:46
Definition: GUITextureGL.h:20