xbmc
RenderBufferGuiTexture.h
1 /*
2  * Copyright (C) 2017-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 "cores/GameSettings.h"
12 #include "cores/RetroPlayer/buffers/BaseRenderBuffer.h"
13 #include "guilib/Texture.h"
14 #include "guilib/TextureFormats.h"
15 
16 #include <memory>
17 
18 namespace KODI
19 {
20 namespace RETRO
21 {
23 {
24 public:
25  CRenderBufferGuiTexture(SCALINGMETHOD scalingMethod);
26  ~CRenderBufferGuiTexture() override = default;
27 
28  // implementation of IRenderBuffer via CBaseRenderBuffer
29  bool Allocate(AVPixelFormat format, unsigned int width, unsigned int height) override;
30  size_t GetFrameSize() const override;
31  uint8_t* GetMemory() override;
32  DataAccess GetMemoryAccess() const override { return DataAccess::READ_WRITE; }
33  bool UploadTexture() override;
34  void BindToUnit(unsigned int unit) override;
35 
36  // GUI texture interface
37  CTexture* GetTexture() { return m_texture.get(); }
38 
39 protected:
40  AVPixelFormat TranslateFormat(unsigned int textureFormat);
41  TEXTURE_SCALING TranslateScalingMethod(SCALINGMETHOD scalingMethod);
42 
43  // Texture parameters
44  SCALINGMETHOD m_scalingMethod;
45  unsigned int m_textureFormat = XB_FMT_UNKNOWN;
46  std::unique_ptr<CTexture> m_texture;
47 };
48 
49 } // namespace RETRO
50 } // namespace KODI
size_t GetFrameSize() const override
Definition: RenderBufferGuiTexture.cpp:43
Definition: RenderBufferGuiTexture.h:22
Base texture class, subclasses of which depend on the render spec (DX, GL etc.)
Definition: Texture.h:34
Controller configuration window.
Definition: AudioDecoder.h:18
Definition: BaseRenderBuffer.h:20