Line data Source code
1 :
2 : /* Copyright (c) 2009-2013, Stefan Eilemann <eile@equalizergraphics.com>
3 : * 2009, Maxim Makhinya
4 : *
5 : * This library is free software; you can redistribute it and/or modify it under
6 : * the terms of the GNU Lesser General Public License version 2.1 as published
7 : * by the Free Software Foundation.
8 : *
9 : * This library is distributed in the hope that it will be useful, but WITHOUT
10 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12 : * details.
13 : *
14 : * You should have received a copy of the GNU Lesser General Public License
15 : * along with this library; if not, write to the Free Software Foundation, Inc.,
16 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17 : */
18 :
19 : #ifndef EQ_SYSTEM_PIPE_H
20 : #define EQ_SYSTEM_PIPE_H
21 :
22 : #include <eq/client/api.h>
23 : #include <eq/client/error.h> // enum
24 : #include <eq/client/types.h>
25 : #include <string>
26 :
27 : namespace eq
28 : {
29 : /**
30 : * The interface definition for system-specific GPU handling.
31 : *
32 : * The SystemPipe abstracts all OS-system specific code for handling a GPU,
33 : * which facilitates porting to new windowing systems. Each Pipe uses one
34 : * SystemPipe, which is initialized in Pipe::configInit. The SystemPipe has
35 : * to set the pipe's PixelViewport if it is invalid during configInit().
36 : */
37 : class SystemPipe
38 : {
39 : public:
40 : /** Create a new SstemPipe for the given eq::Pipe. @version 1.0 */
41 : EQ_API SystemPipe( Pipe* parent );
42 :
43 : /** Destroy the SystemPipe. @version 1.0 */
44 : EQ_API virtual ~SystemPipe( );
45 :
46 : /** @name Methods forwarded from eq::Pipe. */
47 : //@{
48 : /** Initialize the GPU. @version 1.0 */
49 : EQ_API virtual bool configInit() = 0;
50 :
51 : /** De-initialize the GPU. @version 1.0 */
52 : EQ_API virtual void configExit() = 0;
53 : //@}
54 :
55 : /** @return the parent Pipe. @version 1.0 */
56 91 : Pipe* getPipe() { return _pipe; }
57 :
58 : /** @return the parent Pipe. @version 1.0 */
59 : const Pipe* getPipe() const { return _pipe; }
60 :
61 : protected:
62 : /** @name Error information. */
63 : //@{
64 : /**
65 : * Send a pipe error event to the application node.
66 : * @param error the error code.
67 : * @version 1.7.1
68 : */
69 : EQ_API EventOCommand sendError( const uint32_t error );
70 : //@}
71 :
72 : private:
73 : /** The parent eq::Pipe. */
74 : Pipe* const _pipe;
75 : };
76 : }
77 :
78 : #endif // EQ_SYSTEM_PIPE_H
|