![]() |
|
AllegroGL: How to make textures from datafile-bitmaps? |
maxx.t
Member #8,210
January 2007
|
I have the following question: Why does texture_id = allegro_gl_make_texture ((BITMAP *)dat[SOME_BITMAP].dat); results in a very dark (almost black) texture whereas bmp = load_bitmap("some_bitmap.pcx",pal); works fine although dat[SOME_BITMAP] is the grabbed file "some_bitmap.pcx". |
gnolam
Member #2,030
March 2002
![]() |
Have you set color depth, graphics mode, color conversion etc. before loading the datafile? -- |
maxx.t
Member #8,210
January 2007
|
I loaded the datafile before setting up the graphic mode. Loading the datafile after the graphics setup results in the right intensitiy Changing the color depth to the one of the bitmap (8 bit) or using set_palette() |
Neil Walker
Member #210
April 2000
![]() |
why not just save the image as an rgb rather than paletted image? Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
gnolam
Member #2,030
March 2002
![]() |
Due to the way 8-bit images are stored in datafiles, you'll have to load and set the proper palette before loading the datafile. So:
</li> -- |
maxx.t
Member #8,210
January 2007
|
Thank you very much! |
|