4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include "Hardware/Display.hpp"
36 unsigned width
= GetSystemMetrics(SM_CXSCREEN
);
37 unsigned height
= GetSystemMetrics(SM_CYSCREEN
);
38 printf("Width: %d px | Height: %d px\n", width
, height
);
45 printf("DPI X: %d | DPI Y: %d\n", Display::GetXDPI(), Display::GetYDPI());
51 #if defined(DM_DISPLAYORIENTATION) && defined(_WIN32_WCE) && _WIN32_WCE >= 0x400
53 memset(&dm
, 0, sizeof(dm
));
54 dm
.dmSize
= sizeof(dm
);
55 dm
.dmFields
= DM_DISPLAYQUERYORIENTATION
;
57 if (ChangeDisplaySettingsEx(NULL
, &dm
, NULL
, CDS_TEST
, NULL
)
58 != DISP_CHANGE_SUCCESSFUL
) {
59 printf("Display Rotation not supported\n");
63 printf("Display Rotation supported\n");
65 DWORD dwSupported
= dm
.dmDisplayOrientation
;
67 printf("Supported Orientations: 0");
68 if (DMDO_90
& dwSupported
)
70 if (DMDO_180
& dwSupported
)
72 if (DMDO_270
& dwSupported
)
76 dm
.dmFields
= DM_DISPLAYORIENTATION
;
77 if (ChangeDisplaySettingsEx(NULL
, &dm
, NULL
, CDS_TEST
, NULL
)
78 != DISP_CHANGE_SUCCESSFUL
) {
79 printf("Current Display Rotation not available\n");
83 printf("Current Display Rotation: ");
84 if (dm
.dmDisplayOrientation
== DMDO_0
)
86 else if (dm
.dmDisplayOrientation
== DMDO_90
)
88 else if (dm
.dmDisplayOrientation
== DMDO_180
)
90 else if (dm
.dmDisplayOrientation
== DMDO_270
)
99 main(int argc
, char **argv
)
101 printf("Display Information\n\n");
108 // Console on WinCE is closing automatically
109 // We prevent this by requesting user input