|
Allegro GL color mismatch |
anto80
Member #3,230
February 2003
|
Hello all, I am experiencing problem with colors in Allegro GL. Here is a sample code that illustrate the problem. Any idea please??
___________ |
razor
Member #2,256
April 2002
|
try using GL_BGR instead of GL_RGB, that would switch the order wouldn't it? Whoooo Oregon State University |
Kitty Cat
Member #2,815
October 2002
|
set_color_depth(24); You're confusing Allegro, there. -- |
anto80
Member #3,230
February 2003
|
Thank you for your feedback. Kitty Cat said:
set_color_depth(24); and allegro_gl_set(AGL_COLOR_DEPTH, 32);
OK i have now set_color_depth(32); and then, few lines of code later... allegro_gl_set(AGL_COLOR_DEPTH, 32); razor said: try using GL_BGR instead of GL_RGB, that would switch the order wouldn't it? Wow! I didn't know I could even do that! I have done another test: => Therefore, the problem comes from the loading of the texture. How should i use allegro_gl_make_texture_ex
___________ |
Milan Mimica
Member #3,877
September 2003
|
Have you installed manufacturer GFX card drivers or are you using MS ones?
-- |
anto80
Member #3,230
February 2003
|
hmm. Having looked at the AllegroGL's texture.c code, and taking into account that i got an ATI Radeon, here is what i found: 01012 /* ATI Radeon 7000 inverts R and B components when generating mipmaps and 01013 * the internal format is GL_RGB8, bt only on mipmaps. Instead, we'll use 01014 * GL_RGBA8. This works for bitmaps of depth <= 24. For 32-bpp bitmaps, 01015 * some additional tricks are needed: We must fill in alpha with 255. 01016 */ So after having done the code below, all is working fine !!
___________ |
Bob
Free Market Evangelist
September 2000
|
What graphics card do you have? Which driver version are you using? -- |
anto80
Member #3,230
February 2003
|
ATI Radeon X600. Driver v8.162.0.0 (03/08/2005) ___________ |
Bob
Free Market Evangelist
September 2000
|
If you hack FakeGL's detection code to always set is_ati_radeon_7000 to 1 (in glext.c, function __fill_in_info_struct), does this solve your problem? It might be a general ATI issue, but we only had a Radeon 7000 to test it with. -- |
|