Line data Source code
1 :
2 : /* Copyright (c) 2011-2015, Stefan Eilemann <eile@eyescale.ch>
3 : * Daniel Nachbaur <danielnachbaur@gmail.com>
4 : * Petros Kataras <petroskataras@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 EQSEQUEL_DETAIL_RENDERER_H
21 : #define EQSEQUEL_DETAIL_RENDERER_H
22 :
23 : #include <seq/types.h>
24 :
25 : namespace seq
26 : {
27 : namespace detail
28 : {
29 : /** The internal implementation for the renderer. */
30 : class Renderer
31 : {
32 : public:
33 : Renderer();
34 : ~Renderer();
35 :
36 : /** @name Data Access. */
37 : //@{
38 : co::Object* getFrameData();
39 0 : const GLEWContext* glewGetContext() const { return _glewContext; }
40 :
41 : const ObjectManager& getObjectManager() const;
42 : ObjectManager& getObjectManager();
43 :
44 : const ViewData* getViewData() const;
45 :
46 : const RenderContext& getRenderContext() const;
47 : const Frustumf& getFrustum() const;
48 : const Matrix4f& getViewMatrix() const;
49 : const Matrix4f& getModelMatrix() const;
50 : const PixelViewport& getPixelViewport() const;
51 :
52 : bool useOrtho() const;
53 : void setNearFar( const float nearPlane, const float farPlane );
54 : //@}
55 :
56 : /** @name Current context. */
57 : //@{
58 0 : void setPipe( Pipe* pipe ) { _pipe = pipe; }
59 : void setWindow( Window* window );
60 : void setChannel( Channel* channel );
61 :
62 0 : const Window* getWindow() const { return _window; }
63 : //@}
64 :
65 : /** @name Operations. */
66 : //@{
67 : bool initContext();
68 : bool exitContext();
69 :
70 : void clear();
71 : void requestRedraw();
72 :
73 : void applyRenderContext();
74 : void applyModelMatrix();
75 : void bindDrawFrameBuffer();
76 :
77 : void applyScreenFrustum();
78 : void applyPerspectiveFrustum();
79 : //@}
80 :
81 : /** @name Distributed Object API. */
82 : //@{
83 : co::Object* mapObject( const uint128_t& identifier,
84 : co::Object* instance = 0 );
85 : bool unmap( co::Object* object );
86 :
87 : private:
88 : const GLEWContext* _glewContext;
89 : Pipe* _pipe;
90 : Window* _window;
91 : Channel* _channel;
92 : };
93 : }
94 : }
95 :
96 : #endif // EQSEQUEL_DETAIL_RENDERER_H
|