Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » Linux 24 bit depth issue

This thread is locked; no one can reply to it. rss feed Print
Linux 24 bit depth issue
Lucas Dalmasso
Member #20,839
August 2021

Im doing some basic low level things with allegro like locking bitmaps and manipulating the memory inside.
The thing is that linux says it's in 24 bit depth and i drive my things in 32 bit depths. I need 32 bit support for linux.
I have searched how to change config to linux to 32 bit depth but nothing answer my question.
So how do i do 32 bit dev in linux?

Dizzy Egg
Member #10,824
March 2009
avatar

Have you tried using al_set_new_bitmap_flags and choosing one of the 32-but flags ?

----------------------------------------------------
Please check out my songs:
https://soundcloud.com/dont-rob-the-machina

Polybios
Member #12,293
October 2010

IIRC you either get 24 or 32 bit modes depending on the system. You should be able to create a video bitmap with 32 bits in any case and work on that.

But trying to force it as Dizzy Egg suggested is worth a try.

Mark Oates
Member #1,146
March 2001
avatar

It's possible your machine doesn't support 32-bit depth. My MacBook Pro M1 has a 32-bit depth, but my MacMini only has 24. Same with my Windows laptop which only supports 24-bit depth. All of them are relatively new devices.

Similar to what Dizzy said, you can pass 32 when creating your display and see if it sticks:

int preferred_depth_size = 32;
al_set_new_display_option(ALLEGRO_DEPTH_SIZE, preferred_depth_size, ALLEGRO_SUGGEST);
ALLEGRO_DISPLAY *al_display = al_create_display(1920, 1080);
if (!al_display) print("Display could not be created");
int actual_depth_size = al_get_display_option(al_display, ALLEGRO_DEPTH_SIZE);

printf("Display depth info:\n  - expected:%d\n  - actual:%d", preferred_depth_size, actual_depth_size);

What do you need specifically a 32 bit depth for, I'm curious.

--
Visit CLUBCATT.com for cat shirts, cat mugs, puzzles, art and more <-- coupon code ALLEGRO4LIFE at checkout and get $3 off any order of 3 or more items!

AllegroFlareAllegroFlare DocsAllegroFlare GitHub

Go to: