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
5 #ifndef __IRR_OS_H_INCLUDED__
\r
6 #define __IRR_OS_H_INCLUDED__
\r
8 #include "irrTypes.h"
\r
9 #include "irrString.h"
\r
11 #include "ILogger.h"
\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
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
42 // The string ": " is added between message and hint
\r
43 static void log(const c8* message, const c8* hint, ELOG_LEVEL ll = ELL_INFORMATION);
\r
44 static void log(const c8* message, const io::path& hint, ELOG_LEVEL ll = ELL_INFORMATION);
\r
45 static ILogger* Logger;
\r
52 //! returns the current time in milliseconds
\r
53 static u32 getTime();
\r
55 //! get current time and date in calendar form
\r
56 static ITimer::RealTimeDate getRealTimeAndDate();
\r
58 //! initializes the real timer
\r
59 static void initTimer(bool usePerformanceTimer=true);
\r
61 //! sets the current virtual (game) time
\r
62 static void setTime(u32 time);
\r
64 //! stops the virtual (game) timer
\r
65 static void stopTimer();
\r
67 //! starts the game timer
\r
68 static void startTimer();
\r
70 //! sets the speed of the virtual timer
\r
71 static void setSpeed(f32 speed);
\r
73 //! gets the speed of the virtual timer
\r
74 static f32 getSpeed();
\r
76 //! returns if the timer currently is stopped
\r
77 static bool isStopped();
\r
79 //! makes the virtual timer update the time value based on the real time
\r
82 //! returns the current real time in milliseconds
\r
83 static u32 getRealTime();
\r
87 static void initVirtualTimer();
\r
89 static f32 VirtualTimerSpeed;
\r
90 static s32 VirtualTimerStopCounter;
\r
91 static u32 StartRealTime;
\r
92 static u32 LastVirtualTime;
\r
93 static u32 StaticTime;
\r
96 } // end namespace os
\r
97 } // end namespace irr
\r