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

video_timer.hpp « platform - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 58e4201f7c3c2ae85f0ec134bc8876bacec8b90c (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
#pragma once

#include "../std/function.hpp"

/// Timer, synchronized to Vertical Sync
class VideoTimer
{
public:

  typedef function<void()> TFrameFn;

  enum EState
  {
    EStopped,
    EPaused,
    ERunning
  };

protected:

  TFrameFn m_frameFn;
  EState m_state;

public:
  VideoTimer(TFrameFn fn);
  virtual ~VideoTimer();

  TFrameFn frameFn() const;
  void setFrameFn(TFrameFn fn);

  EState state() const;

  virtual void resume() = 0;
  virtual void pause() = 0;

  virtual void start() = 0;
  virtual void stop() = 0;
};

extern "C" VideoTimer * CreateIOSVideoTimer(VideoTimer::TFrameFn frameFn);
extern "C" VideoTimer * CreateAppleVideoTimer(VideoTimer::TFrameFn frameFn);
extern "C" VideoTimer * CreateWin32VideoTimer(VideoTimer::TFrameFn frameFn);
extern "C" VideoTimer * CreatePThreadVideoTimer(VideoTimer::TFrameFn frameFn);