|
How to set Display properties? |
Doctor Cop
Member #16,833
April 2018
|
I am trying to find a way to set Display size according to screen size. Is there a already something which I can use, if not then how can I achieve something like this on my own.
|
Peter Hull
Member #1,136
March 2001
|
Probably you want al_get_monitor_info. e.g. 1#include <cstdio>
2#include <allegro5/allegro.h>
3
4int main(int, char* []) {
5 al_init();
6 int c = al_get_num_video_adapters();
7 for (int i = 0; i < c; ++i) {
8 ALLEGRO_MONITOR_INFO info;
9 if (al_get_monitor_info(i, &info)) {
10 printf("%d. (%d, %d)-(%d, %d)\n", i,
11 info.x1, info.y1,
12 info.x2, info.y2);
13 } else {
14 printf("%d. no info\n", i);
15 }
16 }
17 return 0;
18}
[edit] or maybe al_get_display_mode if you want to know what fullscreen modes your monitor will support.
|
Doctor Cop
Member #16,833
April 2018
|
Thanks!
|
roger levy
Member #2,513
July 2002
|
|