| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "GUITexture.h" |
| 12 |
#include "utils/ColorUtils.h" |
| 13 |
|
| 14 |
#include <array> |
| 15 |
#include <vector> |
| 16 |
|
| 17 |
#include "system_gl.h" |
| 18 |
|
| 19 |
struct PackedVertex |
| 20 |
{ |
| 21 |
float x, y, z; |
| 22 |
float u1, v1; |
| 23 |
float u2, v2; |
| 24 |
}; |
| 25 |
typedef std::vector<PackedVertex> PackedVertices; |
| 26 |
|
| 27 |
class CRenderSystemGLES; |
| 28 |
|
| 29 |
class CGUITextureGLES : public CGUITexture |
| 30 |
{ |
| 31 |
public: |
| 32 |
static void Register(); |
| 33 |
static CGUITexture* CreateTexture( |
| 34 |
float posX, float posY, float width, float height, const CTextureInfo& texture); |
| 35 |
|
| 36 |
static void DrawQuad(const CRect& coords, |
| 37 |
UTILS::COLOR::Color color, |
| 38 |
CTexture* texture = nullptr, |
| 39 |
const CRect* texCoords = nullptr); |
| 40 |
|
| 41 |
CGUITextureGLES(float posX, float posY, float width, float height, const CTextureInfo& texture); |
| 42 |
~CGUITextureGLES() override = default; |
| 43 |
|
| 44 |
CGUITextureGLES* Clone() const override; |
| 45 |
|
| 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; |
| 50 |
|
| 51 |
private: |
| 52 |
CGUITextureGLES(const CGUITextureGLES& texture) = default; |
| 53 |
|
| 54 |
std::array<GLubyte, 4> m_col; |
| 55 |
|
| 56 |
PackedVertices m_packedVertices; |
| 57 |
std::vector<GLushort> m_idx; |
| 58 |
CRenderSystemGLES *m_renderSystem; |
| 59 |
}; |
| 60 |
|