summaryrefslogtreecommitdiff
path: root/src/mbgl/gl/texture_resource.hpp
blob: 494e5ae8a36eb5bb1a174cd8b92770e47f2c148c (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
#pragma once

#include <mbgl/gfx/texture.hpp>
#include <mbgl/gl/object.hpp>

namespace mbgl {
namespace gl {

class TextureResource : public gfx::TextureResource {
public:
    TextureResource(UniqueTexture&& texture_, int byteSize_) : texture(std::move(texture_)), byteSize(byteSize_) {}
    ~TextureResource();

    static int getStorageSize(const Size& size, gfx::TexturePixelType format, gfx::TextureChannelDataType type);

    UniqueTexture texture;
    gfx::TextureFilterType filter = gfx::TextureFilterType::Nearest;
    gfx::TextureMipMapType mipmap = gfx::TextureMipMapType::No;
    gfx::TextureWrapType wrapX = gfx::TextureWrapType::Clamp;
    gfx::TextureWrapType wrapY = gfx::TextureWrapType::Clamp;
    int byteSize;
};

} // namespace gl
} // namespace mbgl