Base class for all OpenGL resources that reside in GPU memory. More...
#include <Luminous/ResourceHandleGL.hpp>
Public Member Functions | |
| bool | expired () const |
| Check if the resource has expired. More... | |
| GLuint | handle () const |
| Get the raw OpenGL handle for the resource. More... | |
| ResourceHandleGL & | operator= (ResourceHandleGL &&r) |
| Move assignment operator. More... | |
| ResourceHandleGL (StateGL &state) | |
| Constructor. More... | |
| ResourceHandleGL (ResourceHandleGL &&r) | |
| Move constructor. More... | |
| void | setExpirationSeconds (unsigned int secs) |
| Set the expiration time in seconds for the resource. More... | |
| void | touch () |
| Update the last used timestamp to current frame-time. More... | |
Protected Attributes | |
| GLuint | m_handle |
| Raw OpenGL handle of the resource. | |
| StateGL & | m_state |
| OpenGL state owned by the graphics driver. | |
Base class for all OpenGL resources that reside in GPU memory.
|
inline |
Constructor.
| state | OpenGL state of the graphics driver |
|
inline |
Move constructor.
| r | resource handle to move |
|
inline |
Check if the resource has expired.
Resource is considered expired if the time since it was last accessed exceeds the defined expiration time. Expired resources are released by the graphics driver to conserve GPU memory.
|
inline |
Get the raw OpenGL handle for the resource.
|
inline |
Move assignment operator.
| r | resource handle to move |
|
inline |
|
inline |
Update the last used timestamp to current frame-time.
Every time the resource is accessed, this should be updated.