Skip to content

GUIImage ​

A class for holding an image texture id with properties of the image. More...

#include "Tutorial/GUIImage.h"

Public Functions ​

Name
GUIImage(const GUIImage & other) =delete<br>Copy constructor is NOT ALLOWED - use pointers (preferably smart) if you want to have the image referable from multiple places.
GUIImage(const std::string & path)<br>Constructor which loads the specified image into OpenGl memory.
GUIImage(GUIImage && other)<br>Move constructor which makes sure the previous instance doesn't have the GLuint texture id, which would then be deleted with the destructor.
~GUIImage()<br>Destructor which deletes the image from OpenGL memory.

Public Attributes ​

Name
intm_height
std::stringm_path
unsigned intm_texID
intm_width

Detailed Description ​

cpp
struct GUIImage;

A class for holding an image texture id with properties of the image.

Goes by the RAII standard by loading the image at start and deleting it at its end.

Public Functions Documentation ​

function GUIImage ​

cpp
GUIImage(
    const GUIImage & other
) =delete

Copy constructor is NOT ALLOWED - use pointers (preferably smart) if you want to have the image referable from multiple places.

function GUIImage ​

cpp
GUIImage(
    const std::string & path
)

Constructor which loads the specified image into OpenGl memory.

Parameters:

  • path Whole path to the image file to be loaded

WARNING: Throws an exception when file not found or texture loading fails!

function GUIImage ​

cpp
GUIImage(
    GUIImage && other
)

Move constructor which makes sure the previous instance doesn't have the GLuint texture id, which would then be deleted with the destructor.

function ~GUIImage ​

cpp
~GUIImage()

Destructor which deletes the image from OpenGL memory.

Public Attributes Documentation ​

variable m_height ​

cpp
int m_height;

variable m_path ​

cpp
std::string m_path;

variable m_texID ​

cpp
unsigned int m_texID;

variable m_width ​

cpp
int m_width;

Updated on 2026-09-11 at 21:24:24 +0000