xmscore  1.0
color_defines.h
Go to the documentation of this file.
1 #pragma once
2 //------------------------------------------------------------------------------
9 //------------------------------------------------------------------------------
10 
11 // 3. Standard Library Headers
12 
13 // 4. External Library Headers
14 
15 // 5. Shared Headers
17 // 6. Non-shared Headers
18 
19 //----- Namespace declaration --------------------------------------------------
20 
21 namespace xms
22 {
23 #if defined(ENV64BIT)
24 typedef unsigned __int64 XM_ULONG_PTR;
25 #elif defined(ENV32BIT)
26 typedef unsigned long XM_ULONG_PTR;
27 #else
28 #error "Must define either ENV32BIT or ENV64BIT"
29 #endif
30 
31 typedef unsigned long XM_DWORD;
32 typedef XM_ULONG_PTR XM_DWORD_PTR;
33 typedef unsigned short XM_WORD;
34 typedef unsigned char XM_BYTE;
35 typedef XM_DWORD XM_COLORREF;
36 
37 #define XM_LOBYTE(w) ((xms::XM_BYTE)(((xms::XM_DWORD_PTR)(w)) & 0xff))
38 #define XmsGetRValue(rgb) (XM_LOBYTE(rgb))
39 #define XmsGetGValue(rgb) (XM_LOBYTE(((xms::XM_WORD)(rgb)) >> 8))
40 #define XmsGetBValue(rgb) (XM_LOBYTE((rgb) >> 16))
41 #define XmsRGB(r, g, b) \
42  ((xms::XM_COLORREF)(((xms::XM_BYTE)(r) | ((xms::XM_WORD)((xms::XM_BYTE)(g)) << 8)) | \
43  (((xms::XM_WORD)(xms::XM_BYTE)(b)) << 16)))
44 }
unsigned long XM_DWORD
DWORD rename.
Definition: color_defines.h:31
XM_ULONG_PTR XM_DWORD_PTR
DWORD_PTR rename.
Definition: color_defines.h:32
XM_DWORD XM_COLORREF
COLORREF rename.
Definition: color_defines.h:35
unsigned short XM_WORD
WORD rename.
Definition: color_defines.h:33
64 or 32 bit detection.
unsigned char XM_BYTE
BYTE rename rename.
Definition: color_defines.h:34