xbmc
ShaderTextureGL.h
1 /*
2  * Copyright (C) 2019 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 "cores/RetroPlayer/shaders/IShaderTexture.h"
12 #include "guilib/Texture.h"
13 #include "guilib/TextureGL.h"
14 
15 namespace KODI
16 {
17 namespace SHADER
18 {
20 {
21 public:
22  CShaderTextureGL() = default;
23 
24  CShaderTextureGL(CGLTexture* texture) : m_texture(texture) {}
25  CShaderTextureGL(CGLTexture& texture) : m_texture(&texture) {}
26 
27  // Destructor
28  // Don't delete texture since it wasn't created here
29  ~CShaderTextureGL() override;
30 
31  float GetWidth() const override { return static_cast<float>(m_texture->GetWidth()); }
32  float GetHeight() const override { return static_cast<float>(m_texture->GetHeight()); }
33 
34  CGLTexture* GetPointer() { return m_texture; }
35  bool CreateFBO(int width, int height);
36  void BindFBO();
37  void UnbindFBO();
38 
39 private:
40  CGLTexture* m_texture = nullptr;
41  GLuint FBO = 0;
42 };
43 } // namespace SHADER
44 } // namespace KODI
float GetHeight() const override
Return height of texture.
Definition: ShaderTextureGL.h:32
float GetWidth() const override
Return width of texture.
Definition: ShaderTextureGL.h:31
Definition: AudioDecoder.h:18
Definition: ShaderTextureGL.h:19
Definition: TextureGL.h:18
Definition: IShaderTexture.h:15