Welcome to mirror list, hosted at ThFree Co, Russian Federation.

framebuffer.hpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5c16c9341ba498b1194ccb567f6e632d4582fbd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once

#include "stdint.h"

namespace dp
{
class OGLContext;
}

namespace df
{

class Framebuffer
{
public:
  Framebuffer() = default;
  ~Framebuffer();

  void SetDefaultContext(dp::OGLContext * context);
  void SetSize(uint32_t width, uint32_t height);

  void Enable();
  void Disable();

  uint32_t GetTextureId() const;
  bool IsSupported() const { return m_isSupported; }

private:
  void Destroy();

  uint32_t m_width = 0;
  uint32_t m_height = 0;

  uint32_t m_colorTextureId = 0;
  uint32_t m_depthTextureId = 0;
  uint32_t m_framebufferId = 0;

  dp::OGLContext * m_defaultContext = 0;

  bool m_isSupported = true;
};

}  // namespace df