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
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
50 //! returns the current time in milliseconds
\r
51 static u32 getTime();
\r
53 //! get current time and date in calendar form
\r
54 static ITimer::RealTimeDate getRealTimeAndDate();
\r
56 //! initializes the real timer
\r
57 static void initTimer(bool usePerformanceTimer=true);
\r
59 //! sets the current virtual (game) time
\r
60 static void setTime(u32 time);
\r
62 //! stops the virtual (game) timer
\r
63 static void stopTimer();
\r
65 //! starts the game timer
\r
66 static void startTimer();
\r
68 //! sets the speed of the virtual timer
\r
69 static void setSpeed(f32 speed);
\r
71 //! gets the speed of the virtual timer
\r
72 static f32 getSpeed();
\r
74 //! returns if the timer currently is stopped
\r
75 static bool isStopped();
\r
77 //! makes the virtual timer update the time value based on the real time
\r
80 //! returns the current real time in milliseconds
\r
81 static u32 getRealTime();
\r
85 static void initVirtualTimer();
\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
94 } // end namespace os
\r
95 } // end namespace irr
\r