emilib
os.hpp
1 // By Emil Ernerfeldt 2013-2016
2 // LICENSE:
3 // This software is dual-licensed to the public domain and under the following
4 // license: you are granted a perpetual, irrevocable license to copy, modify,
5 // publish, and distribute this file as you see fit.
6 
7 #pragma once
8 
9 namespace emilib {
10 namespace os {
11 
12 enum class Device
13 {
14  Phone,
15  Tablet,
16  Desktop
17 };
18 
19 Device device();
20 
21 inline bool is_phone() { return device() == Device::Phone; }
22 inline bool is_tablet() { return device() == Device::Tablet; }
23 inline bool is_desktop() { return device() == Device::Desktop; }
24 
25 // ----------------------------------------------------------------------------
26 // Display:
27 
29 float pixels_per_point();
30 
31 #if TARGET_OS_IPHONE
32  struct Size
33  {
34  float width, height;
35  };
36 
37  Size screen_size_points();
38 #endif // TARGET_OS_IPHONE
39 
40 } // namespace os
41 } // namespace emilib
Definition: coroutine.hpp:18