Line data Source code
1 :
2 : /* Copyright (c) 2006-2012, Stefan Eilemann <eile@equalizergraphics.com>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #ifndef EQFABRIC_SWAPBARRIER_H
19 : #define EQFABRIC_SWAPBARRIER_H
20 :
21 : #include <eq/fabric/api.h>
22 : #include <lunchbox/referenced.h> // base class
23 : #include <iostream>
24 :
25 : namespace eq
26 : {
27 : namespace fabric
28 : {
29 : /**
30 : * A swapbarrier is set on a Compound to synchronize the swap buffer between
31 : * windows.
32 : *
33 : * Swap barriers with the same name are linked together, that is, all
34 : * compounds holding a swap barrier with the same name synchronize their
35 : * window's swap command.
36 : */
37 400 : class SwapBarrier : public lunchbox::Referenced
38 : {
39 : public:
40 : /**
41 : * Constructs a new SwapBarrier.
42 : */
43 200 : SwapBarrier() : _nvSwapGroup( 0 ), _nvSwapBarrier( 0 ) {}
44 :
45 : /** @name Data Access. */
46 : //@{
47 200 : void setName( const std::string& name ) { _name = name; }
48 305 : const std::string getName() const { return _name; }
49 :
50 2 : uint32_t getNVSwapGroup() const { return _nvSwapGroup ; }
51 4 : void setNVSwapGroup( uint32_t nvGroup ) { _nvSwapGroup = nvGroup; }
52 :
53 2 : uint32_t getNVSwapBarrier() const { return _nvSwapBarrier; }
54 4 : void setNVSwapBarrier( uint32_t nvBarrier )
55 4 : { _nvSwapBarrier = nvBarrier; }
56 :
57 101 : bool isNvSwapBarrier() const
58 101 : { return ( _nvSwapBarrier || _nvSwapGroup ); }
59 : //@}
60 :
61 : private:
62 : std::string _name;
63 :
64 : uint32_t _nvSwapGroup;
65 : uint32_t _nvSwapBarrier;
66 : };
67 :
68 : EQFABRIC_API std::ostream& operator << ( std::ostream&, const SwapBarrier& );
69 : }
70 : }
71 : #endif // EQFABRIC_SWAPBARRIER_H
|