Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
glsync.h
Go to the documentation of this file.
1 /*
2  This file is part of Mitsuba, a physically based rendering system.
3 
4  Copyright (c) 2007-2014 by Wenzel Jakob and others.
5 
6  Mitsuba is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License Version 3
8  as published by the Free Software Foundation.
9 
10  Mitsuba is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #pragma once
20 #if !defined(__MITSUBA_HW_GLSYNC_H_)
21 #define __MITSUBA_HW_GLSYNC_H_
22 
23 #include <mitsuba/hw/glrenderer.h>
24 #include <mitsuba/hw/gpusync.h>
25 
27 
28 /** \brief OpenGL-based GPUSync implementation
29  * \ingroup libhw
30  */
31 class MTS_EXPORT_HW GLSync : public GPUSync {
32 public:
33  /// Allocate memory for a new synchronization object
34  GLSync();
35 
36  /// Create the synchronization object on the GL
37  void init();
38 
39  /// Wait on the fence (blocking)
40  void wait();
41 
42  /// Enqueue a wait command, but do not block
43  void enqueueWait();
44 
45  /// Remove the synchronization object
46  void cleanup();
47 
49 protected:
50  /// Virtual destructor
51  virtual ~GLSync();
52 protected:
53  GLsync m_sync;
54 };
55 
57 
58 #endif /* __MITSUBA_HW_GLSYNC_H_ */
#define MTS_EXPORT_HW
Definition: platform.h:114
Abstract GPU synchronization object implementing a memory fence operation.
Definition: gpusync.h:31
#define MTS_NAMESPACE_BEGIN
Definition: platform.h:137
virtual void enqueueWait()=0
Enqueue a wait command, but do not block.
#define MTS_DECLARE_CLASS()
This macro must be used in the initial definition in classes that derive from Object.
Definition: class.h:158
virtual void init()=0
Create the synchronization object on the GPU.
virtual void cleanup()=0
Remove the synchronization object.
virtual void wait()=0
Wait on the fence (blocking)
#define MTS_NAMESPACE_END
Definition: platform.h:138
OpenGL-based GPUSync implementation.
Definition: glsync.h:31