|
A5 colour depth and colours in general |
Neil Walker
Member #210
April 2000
|
Hello, 1. How do you specify what depth you want (i.e. the old set_color_depth)? Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Trent Gamblin
Member #261
April 2000
|
Neil Walker said: 1. How do you specify what depth you want (i.e. the old set_color_depth)? Specifically ALLEGRO_COLOR_SIZE, ALLEGRO_RED_SIZE, GREEN_SIZE, BLUE_SIZE. Generally you don't have to worry about RED/GREEN/BLUE size, or even color size, but if you just want a 16 bit backbuffer use ALLEGRO_COLOR_SIZE. Quote: 2. Where are the colour conversion functions (i.e. set_color_conversion), such as converting 32bit to 16bit? Loaded bitmaps are automatically converted to the current format set by al_set_new_bitmap_format. Quote: 3. I take it paletted bitmaps and 8bit is not supported. How do you read 8bpp images? You can load 8bpp images, they will be converted to the format set by al_set_new_bitmap_format as above. There are no 8bpp ALLEGRO_BITMAPs or ALLEGRO_DISPLAYs.
|
Neil Walker
Member #210
April 2000
|
Thanks. That was easy So, looking at the bitmap methods, when you create bitmaps, etc without specifying flags do they get set to the display depth (e.g. ALLEGRO_COLOR_SIZE) or some other default? btw, I'm converting a library that relied on allegro being initialised and configured and used 'screen' to see if allegro was configured. What's the best way in A5, now it has no globals? Just call a display option (e.g. get backbuffer) and see if it returns NULL One more thing, what's the easiest way of checking a colour matches, I used to do something like: if(get_pixel(....)==makecol(1,2,3) but colours now work with structs. I'm sure I could write a function but am asking anyway. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Evert
Member #794
November 2000
|
Neil Walker said: I'm converting a library that relied on allegro being initialised and configured and used 'screen' to see if allegro was configured. What's the best way in A5, now it has no globals? Just call a display option (e.g. get backbuffer) and see if it returns NULL I doubt that'd work. Fortunately, there is al_is_system_installed() Quote: but colours now work with structs. I'm sure I could write a function but am asking anyway. Writing a function is probably the way to go. |
Neil Walker
Member #210
April 2000
|
Thanks again. I never spotted that One thing I'm trying to achieve and I hope this is my last question, is the equivalent of: blit (source, dest, sx, sy, dx, dy, w, h); i.e. al_draw_bitmap seems to only copy full width and height. I take it you have to create a sub-bitmap first in order to blit only part of a bitmap onto another? If so, wouldn't it be more useful to just have a function to do this as I assume it's a very common thing to do? It's getting quite lengthy my code. I'm doing some parallax stuff and assuming you have to first create sub-bitmaps, it's doubling the code. Then I want to draw the bitmap onto itself which it seems you cannot do in A5 now, so that's yet more code to create temporary bitmaps, etc. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Matthew Leverton
Supreme Loser
January 1999
|
Neil Walker
Member #210
April 2000
|
Crikey, I've got the eyesight of a donkey. Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
|