1 #ifndef _REF_COUNTED_GL_SYNC_H
2 #define _REF_COUNTED_GL_SYNC_H 1
4 // A wrapper around GLsync (OpenGL fences) that is automatically refcounted.
5 // Useful since we sometimes want to use the same fence two entirely different
6 // places. (We could set two fences at the same time, but they are not an
7 // unlimited hardware resource, so it would be a bit wasteful.)
12 typedef std::shared_ptr<__GLsync> RefCountedGLsyncBase;
14 class RefCountedGLsync : public RefCountedGLsyncBase {
18 RefCountedGLsync(GLenum condition, GLbitfield flags)
19 : RefCountedGLsyncBase(glFenceSync(condition, flags), glDeleteSync) {}
22 #endif // !defined(_REF_COUNTED_GL_SYNC_H)