Labyrinth
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
androidlxs.hpp
1 //////////////////////////////
2 //
3 // File: platform/android/androidlxs.hpp
4 // Author: Maciej Kaminski
5 // E-mail: maciej.a.kaminski@gmail.com
6 // Website: maciejkaminski.pl
7 //
8 // File creation date: Oct 24 2012
9 // This file is part of Project Labyrinth
10 // This file is going to be released under terms of GNU GPL in near future
11 //
12 //////////////////////////////
13 
14 #ifndef __ANDROID_LXS_HPP_
15 #define __ANDROID_LXS_HPP_
16 #include "lxs/coregraphics/camera.hpp"
17 #include "lxs/system/servicethread.hpp"
18 namespace LxS
19 {
20  namespace System
21  {
22  class AssetLoader;
23  //!Android OS-interface class
24  class AndroidLxS: public LxSGLES
25  {
26  friend
27  void engine_handle_cmd(struct android_app* app, int32_t cmd);
28  friend
29  int32_t engine_handle_input(struct android_app* app, AInputEvent* event);
30  friend class ::LxS::System::AssetLoader;
31  protected:
32  //! android app handle
33  struct android_app* app;
34  //! android sensor managing object
35  ASensorManager* sensorManager;
36  //! gyroscope sensor
37  const ASensor* gyroscopeSensor;
38  //! sensor event queue
39  ASensorEventQueue* sensorEventQueue;
40  //! process an input command
41  void HandleCommand(int32_t cmd);
42  //! process input data
43  void HandleInput(AInputEvent* event);
44  public:
45  //! android event queue handler
46  void HandleEventQueue();
47  virtual ~AndroidLxS();
48  //! proper constructor
49  AndroidLxS(struct android_app* _app);
50  virtual void DrawFrame();
51  virtual void Init(); // called by ctor;
52  virtual void Deinit(); // called by dtor;
53  };
54  //end of class AndroidLxS
55  }
56 
57 }
58 #endif