]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/os.h
Reduce IrrCompileConfig usage to files that actually need it
[irrlicht.git] / source / Irrlicht / os.h
1 // Copyright (C) 2002-2012 Nikolaus Gebhardt\r
2 // This file is part of the "Irrlicht Engine".\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
4 \r
5 #ifndef __IRR_OS_H_INCLUDED__\r
6 #define __IRR_OS_H_INCLUDED__\r
7 \r
8 #include "irrTypes.h"\r
9 #include "irrString.h"\r
10 #include "path.h"\r
11 #include "ILogger.h"\r
12 #include "ITimer.h"\r
13 \r
14 namespace irr\r
15 {\r
16 \r
17 namespace os\r
18 {\r
19         class Byteswap\r
20         {\r
21         public:\r
22                 static u16 byteswap(u16 num);\r
23                 static s16 byteswap(s16 num);\r
24                 static u32 byteswap(u32 num);\r
25                 static s32 byteswap(s32 num);\r
26                 static u64 byteswap(u64 num);\r
27                 static s64 byteswap(s64 num);\r
28                 static f32 byteswap(f32 num);\r
29                 // prevent accidental swapping of chars\r
30                 static u8  byteswap(u8  num);\r
31                 static c8  byteswap(c8  num);\r
32         };\r
33 \r
34         class Printer\r
35         {\r
36         public:\r
37                 // prints out a string to the console out stdout or debug log or whatever\r
38                 static void print(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);\r
39                 static void log(const c8* message, ELOG_LEVEL ll = ELL_INFORMATION);\r
40                 static void log(const wchar_t* message, ELOG_LEVEL ll = ELL_INFORMATION);\r
41                 static void log(const c8* message, const c8* hint, ELOG_LEVEL ll = ELL_INFORMATION);\r
42                 static void log(const c8* message, const io::path& hint, ELOG_LEVEL ll = ELL_INFORMATION);\r
43                 static ILogger* Logger;\r
44         };\r
45 \r
46         class Timer\r
47         {\r
48         public:\r
49 \r
50                 //! returns the current time in milliseconds\r
51                 static u32 getTime();\r
52 \r
53                 //! get current time and date in calendar form\r
54                 static ITimer::RealTimeDate getRealTimeAndDate();\r
55 \r
56                 //! initializes the real timer\r
57                 static void initTimer(bool usePerformanceTimer=true);\r
58 \r
59                 //! sets the current virtual (game) time\r
60                 static void setTime(u32 time);\r
61 \r
62                 //! stops the virtual (game) timer\r
63                 static void stopTimer();\r
64 \r
65                 //! starts the game timer\r
66                 static void startTimer();\r
67 \r
68                 //! sets the speed of the virtual timer\r
69                 static void setSpeed(f32 speed);\r
70 \r
71                 //! gets the speed of the virtual timer\r
72                 static f32 getSpeed();\r
73 \r
74                 //! returns if the timer currently is stopped\r
75                 static bool isStopped();\r
76 \r
77                 //! makes the virtual timer update the time value based on the real time\r
78                 static void tick();\r
79 \r
80                 //! returns the current real time in milliseconds\r
81                 static u32 getRealTime();\r
82 \r
83         private:\r
84 \r
85                 static void initVirtualTimer();\r
86 \r
87                 static f32 VirtualTimerSpeed;\r
88                 static s32 VirtualTimerStopCounter;\r
89                 static u32 StartRealTime;\r
90                 static u32 LastVirtualTime;\r
91                 static u32 StaticTime;\r
92         };\r
93 \r
94 } // end namespace os\r
95 } // end namespace irr\r
96 \r
97 \r
98 #endif\r
99 \r