Line data Source code
1 :
2 : /* Copyright (c) 2011-2013, Stefan Eilemann <eile@eyescale.ch>
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 EQSEQUEL_DETAIL_RENDERER_H
19 : #define EQSEQUEL_DETAIL_RENDERER_H
20 :
21 : #include <seq/types.h>
22 :
23 : namespace seq
24 : {
25 : namespace detail
26 : {
27 : /** The internal implementation for the renderer. */
28 : class Renderer
29 : {
30 : public:
31 : Renderer();
32 : ~Renderer();
33 :
34 : /** @name Data Access. */
35 : //@{
36 : co::Object* getFrameData();
37 0 : const GLEWContext* glewGetContext() const { return _glewContext; }
38 :
39 : const Frustumf& getFrustum() const;
40 : const Matrix4f& getViewMatrix() const;
41 : const Matrix4f& getModelMatrix() const;
42 :
43 : bool useOrtho() const;
44 : void setNearFar( const float nearPlane, const float farPlane );
45 : //@}
46 :
47 : /** @name Current context. */
48 : //@{
49 4 : void setPipe( Pipe* pipe ) { _pipe = pipe; }
50 : void setWindow( Window* window );
51 : void setChannel( Channel* channel );
52 : //@}
53 :
54 : /** @name Operations. */
55 : //@{
56 : bool initContext();
57 : bool exitContext();
58 :
59 : void clear();
60 :
61 : void applyRenderContext();
62 : const RenderContext& getRenderContext() const;
63 : void applyModelMatrix();
64 : //@}
65 :
66 : private:
67 : const GLEWContext* _glewContext;
68 : Pipe* _pipe;
69 : Window* _window;
70 : Channel* _channel;
71 : };
72 : }
73 : }
74 :
75 : #endif // EQSEQUEL_DETAIL_RENDERER_H
|