Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Allegro Wiki A5 Tutorial error or really odd laptop?

This thread is locked; no one can reply to it. rss feed Print
Allegro Wiki A5 Tutorial error or really odd laptop?
Specter Phoenix
Member #1,425
July 2001
avatar

I was reading this tutorial: https://wiki.allegro.cc/index.php?title=Creating_a_fullscreen_display_with_maximum/minimum_resolution

I executed the code and it compiled fine. I started goofing around with just the function for getting the resolution and my laptop doesn't seem to line up with what the wiki states.

Per wiki:

al_get_display_mode(al_get_num_display_modes() - 1, &disp_data); // minimum res
al_get_display_mode(0, &disp_data); // to get maximum supported resolution instead

My code:

#SelectExpand
1#include <iostream> 2 3#include "allegro5/allegro.h" 4 5int main(int argc, char **argv){ 6 ALLEGRO_DISPLAY_MODE disp_data; 7 8 al_init(); // skipped error checking 9 10 al_get_display_mode(al_get_num_display_modes()-1, &disp_data); // wiki states this is minimum 11 std::cout << "Minimum Resolution: " << disp_data.width << " x " << disp_data.height << std::endl; 12 13 al_get_display_mode(0, &disp_data); // wiki states this is maximum 14 std::cout << "Maximum Resolution: " << disp_data.width << " x " << disp_data.height << std::endl; 15 16 return 0; 17}

The output is what made it confusing.

>a5test
Minimum Resolution: 1366 x 768
Maximum Resolution: 320 x 200

So is this a wiki error, my strange laptop, or am I misreading the code or wiki?

"Can't a man even talk to himself without being interrupted?" -Krull(1983)
"Through vengence I was born. Through war I was trained. Through love I was found. Through death I was released. Through release I was given a purpose." -- Specter Phoenix
"Programming == AWESOME the rest is just tools to accomplish it."
END OF LINE

Edgar Reynaldo
Member #8,592
May 2007
avatar

Specter Phoenix
Member #1,425
July 2001
avatar

Okay. I just wanted to verify it as I was just starting to think maybe I had a weird graphics card [Intel].

"Can't a man even talk to himself without being interrupted?" -Krull(1983)
"Through vengence I was born. Through war I was trained. Through love I was found. Through death I was released. Through release I was given a purpose." -- Specter Phoenix
"Programming == AWESOME the rest is just tools to accomplish it."
END OF LINE

SiegeLord
Member #7,827
October 2006
avatar

I don't think the order is defined. On Linux, 0 yields the largest option for me. The wiki is wrong, yes.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Chris Katko
Member #1,881
January 2002
avatar

I had a weird graphics card [Intel].

Don't worry. You do. ;)

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Go to: