Gamedev Framework (gf) 1.2.0
A C++17 framework for 2D games
Public Member Functions | List of all members
gf::GraphicsHandle< Tag > Class Template Reference

A GL handle. More...

#include <gf/GraphicsHandle.h>

Public Member Functions

 GraphicsHandle ()
 Constructor. More...
 
constexpr GraphicsHandle (NoneType) noexcept
 Constructor. More...
 
 ~GraphicsHandle () noexcept
 Destructor. More...
 
 GraphicsHandle (const GraphicsHandle &)=delete
 Deleted copy constructor. More...
 
GraphicsHandleoperator= (const GraphicsHandle &)=delete
 Deleted copy assignment. More...
 
 GraphicsHandle (GraphicsHandle &&other) noexcept
 Move constructor. More...
 
GraphicsHandleoperator= (GraphicsHandle &&other) noexcept
 Move assignment. More...
 
bool isValid () const noexcept
 Check if the handle is valid. More...
 
unsigned getName () const noexcept
 Get the underlying name of the handle. More...
 
 operator unsigned () const noexcept
 Conversion operator to the underlying name. More...
 

Detailed Description

template<GraphicsTag Tag>
class gf::GraphicsHandle< Tag >

A GL handle.

This class is a RAII class around an OpenGL name.

Constructor & Destructor Documentation

◆ GraphicsHandle() [1/4]

template<GraphicsTag Tag>
gf::GraphicsHandle< Tag >::GraphicsHandle ( )
inline

Constructor.

Generate a valid handle.

◆ GraphicsHandle() [2/4]

template<GraphicsTag Tag>
constexpr gf::GraphicsHandle< Tag >::GraphicsHandle ( NoneType  )
inlineconstexprnoexcept

Constructor.

Generate an invalid handle.

◆ ~GraphicsHandle()

template<GraphicsTag Tag>
gf::GraphicsHandle< Tag >::~GraphicsHandle ( )
inlinenoexcept

Destructor.

◆ GraphicsHandle() [3/4]

template<GraphicsTag Tag>
gf::GraphicsHandle< Tag >::GraphicsHandle ( const GraphicsHandle< Tag > &  )
delete

Deleted copy constructor.

◆ GraphicsHandle() [4/4]

template<GraphicsTag Tag>
gf::GraphicsHandle< Tag >::GraphicsHandle ( GraphicsHandle< Tag > &&  other)
inlinenoexcept

Move constructor.

Parameters
otherAnother handle

Member Function Documentation

◆ getName()

template<GraphicsTag Tag>
unsigned gf::GraphicsHandle< Tag >::getName ( ) const
inlinenoexcept

Get the underlying name of the handle.

Returns
A GL name

◆ isValid()

template<GraphicsTag Tag>
bool gf::GraphicsHandle< Tag >::isValid ( ) const
inlinenoexcept

Check if the handle is valid.

Returns
True if the handle is valid

◆ operator unsigned()

template<GraphicsTag Tag>
gf::GraphicsHandle< Tag >::operator unsigned ( ) const
inlinenoexcept

Conversion operator to the underlying name.

See also
getName()

◆ operator=() [1/2]

template<GraphicsTag Tag>
GraphicsHandle & gf::GraphicsHandle< Tag >::operator= ( const GraphicsHandle< Tag > &  )
delete

Deleted copy assignment.

◆ operator=() [2/2]

template<GraphicsTag Tag>
GraphicsHandle & gf::GraphicsHandle< Tag >::operator= ( GraphicsHandle< Tag > &&  other)
inlinenoexcept

Move assignment.

Parameters
otherAnother handle
Returns
A reference to this handle