Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [A5] Fullscreen Fails in Ubuntu

This thread is locked; no one can reply to it. rss feed Print
[A5] Fullscreen Fails in Ubuntu
Eric Johnson
Member #14,841
January 2013
avatar

Good evening (or perhaps one of the other times).

I am porting a game I'm developing over to Ubuntu, but have ran into an issue.
It seems that if I set the display flags to ALLEGRO_FULLSCREEN, it fails.

Here's my display code (quite simple):

al_set_new_display_flags(ALLEGRO_FULLSCREEN);
  
  ALLEGRO_DISPLAY *display = al_create_display(screenW, screenH);

Here's my error: "/home/ericii/Desktop/allegro/src/events.c:151: al_register_event_source: Assertion `source' failed."

Should I set the display flags to ALLEGRO_WINDOWED, it works just fine. Any ideas, as I would like to have it run in fullscreen?

Thanks!

SiegeLord
Member #7,827
October 2006
avatar

Firstly... you should explicitly check for the display being created or not, instead of having Allegro fail with some internal error.

Secondly... how does screenW and screenH compare to the actual resolution of the monitor? Consider crosschecking those two numbers with the supported resolutions you can obtain with al_get_display_mode. Also consider using ALLEGRO_FULLSCREEN_WINDOW.

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

Thomas Fjellstrom
Member #476
June 2000
avatar

Have you checked to see if display is NULL after you create it?

If you have the debug version of allegro installed, can you link with that, and pastebin your allegro.log file?

I have a feeling its related to nvidia or maybe unity.

edit: Also what SiegeLord said.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Eric Johnson
Member #14,841
January 2013
avatar

My display is NULL only when I have established the fullscreen display flags for it.
I changed my screenW and screenH to 800x600 (opposed to the previous 360x240), and it worked.
So then, why wouldn't it work in the other resolution? How could I achieve this resolution?

Thomas Fjellstrom
Member #476
June 2000
avatar

Sheegoth said:

So then, why wouldn't it work in the other resolution? How could I achieve this resolution?

Modes that small tend not to be supported on modern hardware these days. Newer versions of windows won't even let you set them, even if the hardware supports it last I heard.

You're better off setting a mode that's a multiple of that, and then scaling your drawing to fit the larger mode. IF you only want to have a screen that size.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Eric Johnson
Member #14,841
January 2013
avatar

Upon reviewing the supported resolutions on this machine, I see you are correct.
The lowest it supports is 800x600. That's too bad. :(

That's a lot of work just to get images to scale to size.
I wanted to go for a retro feel, but am not willing at this point to scale things.
On my Raspberry Pi, it scales images by default upon defining fullscreen. How odd.

Thomas Fjellstrom
Member #476
June 2000
avatar

Allegro 5 supports transformations, which are essentially free. Just tell allegro to scale all drawing up to the largest size that fits the current mode, and most people probably can't tell.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Eric Johnson
Member #14,841
January 2013
avatar

Aah, is that so? Hmm... Perhaps it wouldn't be too difficult after all.
I'll look into this.

Arthur Kalliokoski
Second in Command
February 2005
avatar

Those old-skool game programmers that used 320 x 240 would have given their left arm to be able to use higher resolutions without making the frame rate go down to 3 fps. I remember reading an article about Quake I running on one of the first Pentium Pros at 640 x 480, and they were overjoyed how much better it looked.

They all watch too much MSNBC... they get ideas.

Eric Johnson
Member #14,841
January 2013
avatar

Ha ha. Is that so? How far we've come... :P

Luiji99
Member #12,254
September 2010

It's funny how excited people were to get all those pixels, and now some of the most popular Indie games reduced them!

Programming should be fun. That's why I hate Java.

torhu
Member #2,727
September 2002
avatar

Yeah, Minecraft looks like something from 1989. But it feels like something from 1960, so I guess pretty irrevelevant how it looks.

Luiji99
Member #12,254
September 2010

Yeah, to me it feels like something I want to play right now, though.

I've been wasting too much time on that. But I just started my potato farm, I have to complete it!!!

AND WHERE ARE THE MELON SEEDS WHY WON'T YOU SPAWN?!?!?!?!!

I guess I could run /give Luiji99 362, but I want to actually find it!

Wait, what were we talking about?

Programming should be fun. That's why I hate Java.

torhu
Member #2,727
September 2002
avatar

Hey, I'm trying to be a troll here. By not taking the bait you are hurting the feelings I don't have >:(

Thomas Fjellstrom
Member #476
June 2000
avatar

torhu said:

Hey, I'm trying to be a troll here. By not taking the bait you are hurting the feelings I don't have

There's plenty of spots open on the server, you're more than welcome to join ;)

In fact, it doesn't get a lot of use by the Allegroites these days. Mostly a bunch of my friends and their friends and family.

I have a vanila and FTB instance.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

torhu
Member #2,727
September 2002
avatar

But it's like Lego, only it's not even for real >:(

Luiji99
Member #12,254
September 2010

Wait, was I supposed to be offended about that 19?? comment?

I have a vanilla server too, but I'm the only one who logs on to it. :P I like being able to play from any of my computers without having to copy the world around.

Programming should be fun. That's why I hate Java.

Thomas Fjellstrom
Member #476
June 2000
avatar

torhu said:

But it's like Lego, only it's not even for real

WAHT HAO DREA YUO!!!111111noenoenoenoeneon

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Luiji99
Member #12,254
September 2010

It's like LEGOs, but they don't bring you into poverty!! =D

Programming should be fun. That's why I hate Java.

Emanresu
Member #12,510
January 2011

I couldn't get fullscreen to work on my Linux box until I made the resolution the same as the desktop. Really sucks for me since my resolution is 1600x1200 and the built-in card I have can barely handle that resolution for just the desktop. Currently Linux drivers for GFX cards aren't always up to date with their Windows counterparts. This will probably change soon.

"* Entoutcas has quit IRC (Quit: And the Lord said unto John; Come forth and receive eternal life. But John came fifth and won a toaster...)"
"I was in a casino, minding my own business, and this guy came up to me and said, 'You're gonna have to move. You're blocking a fire exit.' As though if there was a fire, I wasn't gonna run. If you're flammable and have legs, you are never blocking a fire exit... ...Unless you're a table."
-Mitch Hedberg (R.I.P.)
"Quit: (+[WG]sPiKie) (Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x].)"

Thomas Fjellstrom
Member #476
June 2000
avatar

Sometimes not being able to change modes is due to an incomplete/broken X config. Or possibly due to your monitor having broken or incomplete EDID information.

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

Go to: