user1477782
user1477782

Reputation:

issue with screen resolution after running an allegro program in full screen

My allegro program runs fine in full screen mode, but after I exit the program, my desktop screen resolution is messed up. I was under the impression that running allegro_exit(); would revert the screen resolution back to what it originally was.

I was just wondering if anyone else has had problems like this and what they did to fix it.

I'm running it on Linux Mint 13

Upvotes: 0

Views: 510

Answers (1)

Matthew
Matthew

Reputation: 48294

First off, hopefully you are at least running Allegro 4.4. But even then, I would highly recommend switching to the 5.0 series. Version 4 is essentially past end-of-life, and as operating systems change, it becomes less likely to work reliably.

That said, you could try explicitly calling set_gfx_mode(GFX_TEXT, 0, 0, 0, 0) to try to cleanly exit the full screen.

Also, you'll have the fewest problems if you set the same mode as the desktop. e.g.:

int w, h;
get_desktop_resolution(&w, &h);
set_color_depth(desktop_color_depth());
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, w, h, 0, 0);

And perhaps GFX_XWINDOWS_FULLSCREEN will work better. Or maybe GFX_XDGA2 running with root permissions. If all that fails, you're likely stuck using windowed mode.

Upvotes: 1

Related Questions