summaryrefslogtreecommitdiff
path: root/include/mbgl/renderer/prerendered_texture.hpp
blob: 9c72e14b886fe9ee483c617ae82829b467e59282 (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
#ifndef MBGL_RENDERER_PRERENDERED_TEXTURE
#define MBGL_RENDERER_PRERENDERED_TEXTURE

#include <mbgl/util/noncopyable.hpp>
#include <mbgl/platform/gl.hpp>
#include <mbgl/style/rasterize_properties.hpp>

namespace mbgl {

class Painter;

class PrerenderedTexture : private util::noncopyable {
public:
    PrerenderedTexture(const RasterizedProperties &properties);
    ~PrerenderedTexture();

    void bindTexture();
    void bindFramebuffer();
    void unbindFramebuffer();

    inline GLuint getTexture() const { return texture; }

    void blur(Painter& painter, uint16_t passes);

public:
    const RasterizedProperties properties;

private:
    GLint previous_fbo = 0;
    GLuint fbo = 0;
    GLuint texture = 0;
};

}

#endif