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

window_handle.hpp « render - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a123d80317bef01a12ddfbf16cce300e280689d6 (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
54
55
56
#pragma once

#include "events.hpp"
#include "drawer.hpp"

#include "platform/video_timer.hpp"

#include "base/logging.hpp"

#include "std/shared_ptr.hpp"


namespace graphics
{
  class RenderContext;
}

class RenderPolicy;

class WindowHandle
{
  shared_ptr<graphics::RenderContext> m_renderContext;
  RenderPolicy * m_renderPolicy;

  bool m_hasPendingUpdates;
  bool m_isUpdatesEnabled;
  bool m_needRedraw;

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

public:

  WindowHandle();
  virtual ~WindowHandle();

  void setRenderPolicy(RenderPolicy * renderPolicy);
  void setVideoTimer(VideoTimer * videoTimer);

  void checkedFrameFn();

  bool needRedraw() const;

  void checkTimer();

  void setNeedRedraw(bool flag);

  shared_ptr<graphics::RenderContext> const & renderContext();

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

  bool setUpdatesEnabled(bool doEnable);

  void invalidate();
};