Beatmup
|
Stores references to GPU resources that will not be used anymore and needed to be recycled in a thread having access to the GPU. More...
#include <recycle_bin.h>
Classes | |
class | Item |
A wrapper for a GPU resource. More... | |
Public Member Functions | |
RecycleBin (Context &ctx) | |
~RecycleBin () | |
void | put (Item *item) |
Puts an item into the recycle bin. More... | |
void | put (std::initializer_list< Item * > items) |
Puts items into the recycle bin. More... | |
void | emptyBin () |
Empty the bin destroying all the items in a GPU-aware thread. More... | |
Public Member Functions inherited from Beatmup::LockableObject | |
void | lock () |
void | unlock () |
Public Member Functions inherited from Beatmup::Object | |
virtual | ~Object () |
Private Attributes | |
std::vector< Item * > | items |
Context & | ctx |
AbstractTask * | recycler |
Stores references to GPU resources that will not be used anymore and needed to be recycled in a thread having access to the GPU.
GPU resources such as texture handles generally cannot be destroyed in a user thread due to OpenGL API restrictions. They are kept in a RecycleBin until the application empties it, which launches a task running in the thread that can access the GPU.
Definition at line 34 of file recycle_bin.h.
RecycleBin::RecycleBin | ( | Context & | ctx | ) |
Definition at line 63 of file recycle_bin.cpp.
RecycleBin::~RecycleBin | ( | ) |
Definition at line 68 of file recycle_bin.cpp.
void RecycleBin::put | ( | RecycleBin::Item * | item | ) |
void RecycleBin::put | ( | std::initializer_list< Item * > | items | ) |
Puts items into the recycle bin.
Definition at line 82 of file recycle_bin.cpp.
void RecycleBin::emptyBin | ( | ) |
Empty the bin destroying all the items in a GPU-aware thread.
Definition at line 91 of file recycle_bin.cpp.
|
private |
Definition at line 48 of file recycle_bin.h.
|
private |
Definition at line 49 of file recycle_bin.h.
|
private |
Definition at line 50 of file recycle_bin.h.