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 "guilib/Shader.h"
12 
13 #include <string>
14 
15 class CGLESShader : public Shaders::CGLSLShaderProgram
16 {
17 public:
18   CGLESShader(const char* shader, const std::string& prefix);
19   CGLESShader(const char* vshader, const char* fshader, const std::string& prefix);
20   void OnCompiledAndLinked() override;
21   bool OnEnabled() override;
22   void Free();
23 
GetPosLoc()24   GLint GetPosLoc()   { return m_hPos;   }
GetColLoc()25   GLint GetColLoc()   { return m_hCol;   }
GetCord0Loc()26   GLint GetCord0Loc() { return m_hCord0; }
GetCord1Loc()27   GLint GetCord1Loc() { return m_hCord1; }
GetUniColLoc()28   GLint GetUniColLoc() { return m_hUniCol; }
GetCoord0MatrixLoc()29   GLint GetCoord0MatrixLoc() { return m_hCoord0Matrix; }
GetFieldLoc()30   GLint GetFieldLoc() { return m_hField; }
GetStepLoc()31   GLint GetStepLoc() { return m_hStep; }
GetContrastLoc()32   GLint GetContrastLoc() { return m_hContrast; }
GetBrightnessLoc()33   GLint GetBrightnessLoc() { return m_hBrightness; }
GetModelLoc()34   GLint GetModelLoc() { return m_hModel; }
HardwareClipIsPossible()35   bool HardwareClipIsPossible() { return m_clipPossible; }
GetClipXFactor()36   GLfloat GetClipXFactor() { return m_clipXFactor; }
GetClipXOffset()37   GLfloat GetClipXOffset() { return m_clipXOffset; }
GetClipYFactor()38   GLfloat GetClipYFactor() { return m_clipYFactor; }
GetClipYOffset()39   GLfloat GetClipYOffset() { return m_clipYOffset; }
40 
41 protected:
42   GLint m_hTex0 = 0;
43   GLint m_hTex1 = 0;
44   GLint m_hUniCol = 0;
45   GLint m_hProj = 0;
46   GLint m_hModel = 0;
47   GLint m_hPos = 0;
48   GLint m_hCol = 0;
49   GLint m_hCord0 = 0;
50   GLint m_hCord1 = 0;
51   GLint m_hCoord0Matrix = 0;
52   GLint m_hField = 0;
53   GLint m_hStep = 0;
54   GLint m_hContrast = 0;
55   GLint m_hBrightness = 0;
56 
57   const GLfloat *m_proj;
58   const GLfloat *m_model;
59 
60   bool m_clipPossible;
61   GLfloat m_clipXFactor;
62   GLfloat m_clipXOffset;
63   GLfloat m_clipYFactor;
64   GLfloat m_clipYOffset;
65 };
66