NasNas
An intuitive and beginner friendly 2D game framework for C++
Activity.hpp
1 // Created by Modar Nasser on 11/09/2021.
2 
3 #pragma once
4 
5 #ifndef __ANDROID__
6 #error "NasNas Android Activity header can only be used when developing for Android platform"
7 #endif
8 
9 #include <string>
10 #include <android/native_activity.h>
11 
12 namespace ns::android {
13 
14  void init();
15 
16  auto getActivity() -> ANativeActivity*;
17 
18  void hideStatusBar();
19  void hideNavigation();
20 
21  enum ScreenOrientation {
22  Landscape,
23  Portrait
24  };
25  void setScreenOrientation(ScreenOrientation orientation);
26 
27  void vibrate(int milliseconds);
28 
29  void showToast(const std::string& text);
30 }