diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2011-09-22 19:58:39 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:24:16 +0300 |
commit | a032f7e6b612e2f1ad0d774067fbb973091897ad (patch) | |
tree | 0112898798f6189c27a71c97df3d45323a181d26 /qt/draw_widget.hpp | |
parent | 11c675cd56f1ac7ddef3414bd000575fe2fd9cd9 (diff) |
introduced VideoTimer, refactored rendering loop to use Timers, as on iOS.
Diffstat (limited to 'qt/draw_widget.hpp')
-rw-r--r-- | qt/draw_widget.hpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/qt/draw_widget.hpp b/qt/draw_widget.hpp index 40daa385ac..254a7235f9 100644 --- a/qt/draw_widget.hpp +++ b/qt/draw_widget.hpp @@ -1,12 +1,14 @@ #pragma once -#include "qt_window_handle.hpp" #include "widgets.hpp" +#include "../map/window_handle.hpp" #include "../map/feature_vec_model.hpp" #include "../map/framework.hpp" #include "../map/navigator.hpp" +#include "../platform/video_timer.hpp" + #include "../std/auto_ptr.hpp" #include <QtCore/QTimer> @@ -28,15 +30,22 @@ namespace qt { typedef widget_type base_type; - shared_ptr<qt::WindowHandle> m_handle; + shared_ptr<WindowHandle> m_handle; + + shared_ptr<drawer_t> m_drawer; + bool m_isInitialized; + bool m_isTimerStarted; typedef model::FeaturesFetcher model_t; auto_ptr<Framework<model_t> > m_framework; + auto_ptr<VideoTimer> m_videoTimer; + bool m_isDrag; QTimer * m_timer; + QTimer * m_animTimer; size_t m_redrawInterval; Q_OBJECT @@ -59,6 +68,7 @@ namespace qt void Repaint(); void ScaleChanged(int action); void ScaleTimerElapsed(); + void AnimTimerElapsed(); public: DrawWidget(QWidget * pParent, storage::Storage & storage); @@ -86,10 +96,12 @@ namespace qt /// @name Overriden from base_type. //@{ virtual void initializeGL(); - virtual void DoDraw(shared_ptr<drawer_t> p); + virtual void DoDraw(shared_ptr<screen_t> p); virtual void DoResize(int w, int h); //@} + void DrawFrame(); + /// @name Overriden from QWidget. //@{ virtual void mousePressEvent(QMouseEvent * e); |