Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » al_get_display_option for ALLEGRO_MAX_BITMAP_SIZE doesn't work on mac

This thread is locked; no one can reply to it. rss feed Print
al_get_display_option for ALLEGRO_MAX_BITMAP_SIZE doesn't work on mac
kovarex
Member #14,203
April 2012

Hello,
we have this line of code in our atlas system, to find out how big can one atlas bitmap be:

unsigned int maxSize = al_get_display_option(global->display.display, ALLEGRO_MAX_BITMAP_SIZE);

It works on windows, but on mac/unix it returns 0 and we have to hardcode something like this:

maxSize = std::max(unsigned(2048), maxSize);

What might be the problem?

www.factorio.com - a factory building game.

Arthur Kalliokoski
Second in Command
February 2005
avatar

I just tried that on Linux, and it works. Are you doing this after creating the display? (I did) OpenGL won't do anything without a context.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Elias
Member #358
May 2000

Looking at the source, it should work under Linux. The size is read here:

https://sourceforge.net/p/alleg/allegro/ci/1911416/tree/src/opengl/extensions.c#l877

glGetIntegerv(GL_MAX_TEXTURE_SIZE, s + ALLEGRO_MAX_BITMAP_SIZE);

Do you have a test-case where you read ALLEGRO_MAX_BITMAP_SIZE after al_create_display and it returns 0, under Linux?

As for OSX, yes, it always returns 0 according to the source code. Can you create a ticket for that [1]? Someone with a Mac will have to implement it.

--
"Either help out or stop whining" - Evert

kovarex
Member #14,203
April 2012

Elias:
Ok, thx I added it as ticket.

www.factorio.com - a factory building game.

Go to: