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 : const ObjectManager& getObjectManager() const;
41 : ObjectManager& getObjectManager();
42 :
43 : const ViewData* getViewData() const;
44 :
45 : const RenderContext& getRenderContext() const;
46 : const Frustumf& getFrustum() const;
47 : const Matrix4f& getViewMatrix() const;
48 : const Matrix4f& getModelMatrix() const;
49 : const PixelViewport& getPixelViewport() const;
50 :
51 : bool useOrtho() const;
52 : void setNearFar(const float nearPlane, const float farPlane);
53 : //@}
54 :
55 : /** @name Current context. */
56 : //@{
57 4 : void setPipe(Pipe* pipe) { _pipe = pipe; }
58 : void setWindow(Window* window);
59 : void setChannel(Channel* channel);
60 :
61 0 : const Window* getWindow() const { return _window; }
62 : //@}
63 :
64 : /** @name Operations. */
65 : //@{
66 : bool initContext();
67 : bool exitContext();
68 :
69 : void clear();
70 : void requestRedraw();
71 :
72 : void applyRenderContext();
73 : void applyModelMatrix();
74 : void bindDrawFrameBuffer();
75 :
76 : void applyScreenFrustum();
77 : void applyPerspectiveFrustum();
78 : //@}
79 :
80 : /** @name Distributed Object API. */
81 : //@{
82 : co::Object* mapObject(const uint128_t& identifier,
83 : co::Object* instance = 0);
84 : bool unmap(co::Object* object);
85 :
86 : private:
87 : const GLEWContext* _glewContext;
88 : Pipe* _pipe;
89 : Window* _window;
90 : Channel* _channel;
91 : };
92 : }
93 : }
94 :
95 : #endif // EQSEQUEL_DETAIL_RENDERER_H
|