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