view OSInfo.h @ 2152:d44b7775fc06

Removed DirectDraw2 compatibility. 3D Sound enabled (change 3DSoundProvider registry entry to activate it). Moved all forward declarations to mm7_unsorted_subs.h (many cpp files do not need them anyweay).
author Nomad
date Thu, 09 Jan 2014 01:37:34 +0200
parents 934074e7fcc1
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;
    }
};