Texture Manager - Horizon-NTH/HorizonGUI GitHub Wiki

TextureManager

Overview

The TextureManager class, located in the hgui namespace, provides a dynamic way to manage Texture in your graphical application.
The class can be found inside the header file TextureManager.

Member Functions

  • std::shared_ptr<kernel::Texture> create(const std::shared_ptr<kernel::Image>& image): Creates a new texture using an image.

Example Usage

#include <hgui/header/TextureManager.h>

{ // Example Usage of TextureManager
    std::shared_ptr<hgui::kernel::Image> image = /* initialize image */;

    // Create a texture
    std::shared_ptr<hgui::kernel::Texture> customTexture = hgui::TextureManager::create(image);

    // Use the texture as needed
    // (Apply the texture to objects here)
} // Here the custom texture is destroyed

Note: In the "Example Usage" section, we demonstrate how to create a custom texture with the TextureManager class.