Merge pull request #24470 from fuzzard/release_20.3
[xbmc.git] / xbmc / rendering / gl / GLShader.h
blobd5b82f3a075b78658c05dcf94000471ceadc7142
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 "guilib/Shader.h"
13 #include <string>
15 class CGLShader : public Shaders::CGLSLShaderProgram
17 public:
18 CGLShader(const char* shader, const std::string& prefix);
19 CGLShader(const char* vshader, const char* fshader, const std::string& prefix);
20 void OnCompiledAndLinked() override;
21 bool OnEnabled() override;
22 void Free();
24 GLint GetPosLoc() {return m_hPos;}
25 GLint GetColLoc() {return m_hCol;}
26 GLint GetCord0Loc() {return m_hCord0;}
27 GLint GetCord1Loc() {return m_hCord1;}
28 GLint GetUniColLoc() {return m_hUniCol;}
29 GLint GetModelLoc() {return m_hModel; }
30 bool HardwareClipIsPossible() {return m_clipPossible; }
31 GLfloat GetClipXFactor() {return m_clipXFactor; }
32 GLfloat GetClipXOffset() {return m_clipXOffset; }
33 GLfloat GetClipYFactor() {return m_clipYFactor; }
34 GLfloat GetClipYOffset() {return m_clipYOffset; }
36 protected:
37 GLint m_hTex0 = 0;
38 GLint m_hTex1 = 0;
39 GLint m_hUniCol = 0;
40 GLint m_hProj = 0;
41 GLint m_hModel = 0;
42 GLint m_hPos = 0;
43 GLint m_hCol = 0;
44 GLint m_hCord0 = 0;
45 GLint m_hCord1 = 0;
47 const GLfloat *m_proj = nullptr;
48 const GLfloat *m_model = nullptr;
50 bool m_clipPossible = false;
51 GLfloat m_clipXFactor;
52 GLfloat m_clipXOffset;
53 GLfloat m_clipYFactor;
54 GLfloat m_clipYOffset;