class TextureResourceHandler

Overview

This class is a workaround to crashes and memory leaks caused by not reserving and freeing opengl textures from the same thread.

class TextureResourceHandler
{
public:
    // methods

    static TextureResourceHandler& Instance();
    texture_name_t generateTextureID(const uint8_t* rgbDataForAssociation);
    std::optional<texture_name_t> checkIfTextureAlreadyExists(const mrpt::img::CImage& rgb);
    void releaseTextureID(unsigned int texName);
};

Methods

texture_name_t generateTextureID(const uint8_t* rgbDataForAssociation)

Return textureName.