MCPcopy Create free account
hub / github.com/android/ndk-samples / Engine

Class Engine

teapots/image-decoder/src/main/cpp/TeapotNativeActivity.cpp:39–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37//-------------------------------------------------------------------------
38struct android_app;
39class Engine {
40 ImageDecoderRender renderer_;
41
42 ndk_helper::GLContext* gl_context_;
43
44 bool initialized_resources_;
45 bool has_focus_;
46
47 ndk_helper::DoubletapDetector doubletap_detector_;
48 ndk_helper::PinchDetector pinch_detector_;
49 ndk_helper::DragDetector drag_detector_;
50 ndk_helper::PerfMonitor monitor_;
51
52 ndk_helper::TapCamera tap_camera_;
53
54 android_app* app_;
55
56 ASensorManager* sensor_manager_;
57 const ASensor* accelerometer_sensor_;
58 ASensorEventQueue* sensor_event_queue_;
59
60 void UpdateFPS(float fFPS);
61 void ShowUI();
62 void TransformPosition(ndk_helper::Vec2& vec);
63
64 public:
65 static void HandleCmd(struct android_app* app, int32_t cmd);
66 static int32_t HandleInput(android_app* app, AInputEvent* event);
67
68 Engine();
69 ~Engine();
70 void SetState(android_app* app);
71 int InitDisplay(android_app* app);
72 void LoadResources();
73 void UnloadResources();
74 void DrawFrame();
75 void TermDisplay();
76 void TrimMemory();
77 bool IsReady();
78
79 void UpdatePosition(AInputEvent* event, int32_t iIndex, float& fX, float& fY);
80
81 void InitSensors();
82 void ProcessSensors(int32_t id);
83 void SuspendSensors();
84 void ResumeSensors();
85};
86
87//-------------------------------------------------------------------------
88// Ctor

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected