annotate OSInfo.h @ 2541:a902abdfc7f2

1. Renamed class Game to class Engine. 2. Separated game logic as state of FSM from game logic as engine. 3. Found out that many UI screen initializers were optimized away, intially they all returned newly created window as separate object like it is done in CharacterUI_Initialize.
author a.parshin
date Sun, 10 May 2015 01:29:11 +0200
parents d44b7775fc06
children
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2 #include "OSAPI.h"
Ritor1
parents:
diff changeset
3
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
4 class OSInfo
0
Ritor1
parents:
diff changeset
5 {
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
6 public:
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
7 inline static bool CanUseDirectDraw4()
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
8 {
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
9 if (Ready())
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
10 return info.dwPlatformId != VER_PLATFORM_WIN32_NT || info.dwMajorVersion >= 4;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
11 return false;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
12 }
0
Ritor1
parents:
diff changeset
13
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
14 inline static bool CanUseDirectDraw2()
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
15 {
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
16 return true;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
17 }
0
Ritor1
parents:
diff changeset
18
Ritor1
parents:
diff changeset
19
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
20 private:
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
21 static bool initialized;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
22 static OSVERSIONINFOA info;
0
Ritor1
parents:
diff changeset
23
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
24 static bool Ready()
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
25 {
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
26 if (!initialized)
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
27 {
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
28 info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOA);
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
29 if (GetVersionExA(&info))
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
30 initialized = true;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
31 }
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
32 return initialized;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
33 }
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 1458
diff changeset
34 };