// http://www.gnu.org/licenses/lgpl-2.1.txt
//////////////////////////////////////////////////////////////////////////////////
-#pragma once
-
//Win32 API
#define WIN32_LEAN_AND_MEAN 1
#include <Windows.h>
#include <Sensapi.h>
#include <Shellapi.h>
#include <PowrProf.h>
+#include <Mmsystem.h>
//Internal
#include <MUtils/Global.h>
}
///////////////////////////////////////////////////////////////////////////////
+// SYSTEM TIMER
+///////////////////////////////////////////////////////////////////////////////
+
+bool MUtils::OS::setup_timer_resolution(const quint32 &interval)
+{
+ return timeBeginPeriod(interval) == TIMERR_NOERROR;
+}
+
+bool MUtils::OS::reset_timer_resolution(const quint32 &interval)
+{
+ return timeEndPeriod(interval) == TIMERR_NOERROR;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+// CHECK KEY STATE
+///////////////////////////////////////////////////////////////////////////////
+
+bool MUtils::OS::check_key_state_esc(void)
+{
+ return (GetAsyncKeyState(VK_ESCAPE) & 0x0001) != 0;
+}
+
+///////////////////////////////////////////////////////////////////////////////
// DEBUGGER CHECK
///////////////////////////////////////////////////////////////////////////////