1 /*         ______   ___    ___
2  *        /\  _  \ /\_ \  /\_ \
3  *        \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___
4  *         \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
5  *          \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
6  *           \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
7  *            \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
8  *                                           /\____/
9  *                                           \_/__/
10  *
11  *      Monitor queries.
12  *
13  *      See LICENSE.txt for copyright information.
14  */
15 
16 
17 #include "allegro5/allegro.h"
18 #include "allegro5/internal/aintern_system.h"
19 
20 
21 /* Function: al_get_num_video_adapters
22  */
al_get_num_video_adapters(void)23 int al_get_num_video_adapters(void)
24 {
25    ALLEGRO_SYSTEM *system = al_get_system_driver();
26 
27    if (system && system->vt && system->vt->get_num_video_adapters) {
28       return system->vt->get_num_video_adapters();
29    }
30 
31    return 0;
32 }
33 
34 /* Function: al_get_monitor_refresh_rate
35  */
al_get_monitor_refresh_rate(int adapter)36 int al_get_monitor_refresh_rate(int adapter)
37 {
38    ALLEGRO_SYSTEM *system = al_get_system_driver();
39 
40    if (adapter < al_get_num_video_adapters()) {
41       if (system && system->vt && system->vt->get_monitor_refresh_rate) {
42          return system->vt->get_monitor_refresh_rate(adapter);
43       }
44    }
45 
46    return 0;
47 }
48 
49 
50 /* Function: al_get_monitor_info
51  */
al_get_monitor_info(int adapter,ALLEGRO_MONITOR_INFO * info)52 bool al_get_monitor_info(int adapter, ALLEGRO_MONITOR_INFO *info)
53 {
54    ALLEGRO_SYSTEM *system = al_get_system_driver();
55 
56    if (adapter < al_get_num_video_adapters()) {
57       if (system && system->vt && system->vt->get_monitor_info) {
58          return system->vt->get_monitor_info(adapter, info);
59       }
60    }
61 
62    info->x1 = info->y1 = info->x2 = info->y2 = INT_MAX;
63    return false;
64 }
65 
66 /* Function: al_get_monitor_dpi
67  */
al_get_monitor_dpi(int adapter)68 int al_get_monitor_dpi(int adapter)
69 {
70    ALLEGRO_SYSTEM *system = al_get_system_driver();
71 
72    if (adapter < al_get_num_video_adapters()) {
73        if (system && system->vt && system->vt->get_monitor_dpi) {
74            return system->vt->get_monitor_dpi(adapter);
75        }
76    }
77 
78    return 0;
79 }
80 
81 /* vim: set sts=3 sw=3 et: */
82