aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu/gl_delayed_allocation.hpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* menu/gl_delayed_allocation: add helper for opengl allocationAlexander Sulfrian2013-01-131-0/+65
opengl allocation could not be done in the constructor of the opengl objects. The opengl calls only have effect when called form the opengl thread, but the objects could be constructed from other threads. The analogous applies to the destruction. This helper handles the allocation on first use from the opengl thread and frees the resources while calling dispose before real destruction (see Disposable). If dispose is called from the opengl thread, it frees the resources immediately, but if dispose is called from another thread it waits (blocks) until the next use from the opengl thread is complete.