![]() |
|
Problems with AllegroGL tga loading and usage. |
Albin Engström
Member #8,110
December 2006
![]() |
RAWR! me angry. anyway: i'm having a problem with loading tga files and using them, the problem is that the alpha channeled pixels are replaced with solid white when i create the texture.(i think, or it could be that i don't save the tga files properly, gah, it could be anything!). Any ideas of why this might happen?? |
GullRaDriel
Member #3,861
September 2003
![]() |
You are not loading the texture correctly. Show us your loading tga code and your display code (both allegro && allegro_gl). Or attach a full example that we can work on.
It is a matter of how you load && display.
"Code is like shit - it only smells if it is not yours" |
Milan Mimica
Member #3,877
September 2003
![]() |
allegro_gl_make_texture_ex(AGL_TEXTURE_HAS_ALPHA | AGL_TEXTURE_RESCALE, bmp, GL_RGBA8); make sure that bmp is 32 bpp color depth.
-- |
GullRaDriel
Member #3,861
September 2003
![]() |
(*spr) -> handles[ it ] = allegro_gl_make_texture( (*spr) -> spr[ it ] ); Is working like a charm for me, using the sets I gave before. "Code is like shit - it only smells if it is not yours" |
Archon
Member #4,195
January 2004
![]() |
Do you need to turn on GL_ALPHA_TEST ? |
GullRaDriel
Member #3,861
September 2003
![]() |
Yes. "Code is like shit - it only smells if it is not yours" |
Milan Mimica
Member #3,877
September 2003
![]() |
Also, since AGL 0.4.1: you can do: bmp = load_tga(); allegro_gl_set_video_bitmap_format(GL_RGBA8); vbmp = create_video_bitmap(bmp->w, bmp->h); blit(bmp, vbmp, 0, 0, 0, 0, vbmp->w, vbmp->h); set_alpha_blender(); draw_trans_sprite(screen, vbmp, x, y);
-- |
GullRaDriel
Member #3,861
September 2003
![]() |
Nice trick , I take note Albin: Is it working now ? "Code is like shit - it only smells if it is not yours" |
Albin Engström
Member #8,110
December 2006
![]() |
No, it isn't :/, i'm going to rewrite the whole thing and then i'll write here again. |
|