Linux 24 bit depth issue
Lucas Dalmasso

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

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

Polybios

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

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.

Thread #618796. Printed from Allegro.cc