Welcome to mirror list, hosted at ThFree Co, Russian Federation.

window_handle.hpp « map - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: af9711c6664519638dc5cd0d7ebb04eddc192bee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#pragma once

#include "../platform/video_timer.hpp"

#include "../std/shared_ptr.hpp"
#include "../std/bind.hpp"
#include "events.hpp"
#include "drawer_yg.hpp"
#include "../base/logging.hpp"

namespace yg
{
  namespace gl
  {
    class RenderContext;
  }
}

class WindowHandle
{
  shared_ptr<yg::gl::RenderContext> m_renderContext;

  bool m_hasPendingUpdates;
  bool m_isUpdatesEnabled;
  bool m_needRedraw;

  VideoTimer * m_videoTimer;
  VideoTimer::TFrameFn m_frameFn;
  int m_stallsCount;

public:

  WindowHandle();
  virtual ~WindowHandle();

  void setVideoTimer(VideoTimer * videoTimer);

  void checkedFrameFn();

  bool needRedraw() const;

  void checkTimer();

  void setNeedRedraw(bool flag);

  shared_ptr<yg::gl::RenderContext> const & renderContext();

  void setRenderContext(shared_ptr<yg::gl::RenderContext> const & renderContext);

  bool setUpdatesEnabled(bool doEnable);

  void invalidate();
};