Mercurial > mm7
view OSInfo.h @ 2253:aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
author | Grumpy7 |
---|---|
date | Wed, 26 Feb 2014 23:35:23 +0100 |
parents | d44b7775fc06 |
children |
line wrap: on
line source
#pragma once #include "OSAPI.h" class OSInfo { public: inline static bool CanUseDirectDraw4() { if (Ready()) return info.dwPlatformId != VER_PLATFORM_WIN32_NT || info.dwMajorVersion >= 4; return false; } inline static bool CanUseDirectDraw2() { return true; } private: static bool initialized; static OSVERSIONINFOA info; static bool Ready() { if (!initialized) { info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA); if (GetVersionExA(&info)) initialized = true; } return initialized; } };