Graphite  Version 3
An experimental 3D geometry processing program
OGF::IconRepository Class Reference

Keeps the correspondence between names and cached icons. More...

#include <OGF/skin_imgui/types/icon_repository.h>

Public Member Functions

 IconRepository ()
 IconRepository constructor.
 
 ~IconRepository ()
 IconRepository destructor.
 
void bind_icon (const std::string &icon_name, GLuint gl_texture)
 Attaches an icon to a given name. More...
 
ImTextureID resolve_icon (const std::string &icon_name, bool mipmap=false) const
 Finds an icon by name. More...
 

Detailed Description

Keeps the correspondence between names and cached icons.

Definition at line 59 of file icon_repository.h.

Member Function Documentation

◆ bind_icon()

void OGF::IconRepository::bind_icon ( const std::string &  icon_name,
GLuint  gl_texture 
)

Attaches an icon to a given name.

If the specified name is already bound, then an error message is displayed.

Parameters
[in]icon_namethe name of the icon
[in]gl_texturethe OpenGL texture that corresponds to the icon.

◆ resolve_icon()

ImTextureID OGF::IconRepository::resolve_icon ( const std::string &  icon_name,
bool  mipmap = false 
) const

Finds an icon by name.

The icon is searched in the already-bound icons and in the lib/icons/ subdirectories of the OGF_PATH. If it is not found, then it is replaced with the "on_icon" icon (a red cross).

Parameters
[in]icon_namethe name of the icon
[in]mipmapif true, and if the icon was not already in the repository, create mipmaps.
Returns
the ImTextureID that corresponds to the icon.

The documentation for this class was generated from the following file: