Thread: Blend problem
View Single Post
Old 11-23-06, 06:31 AM   #3
JeroenH
Registered User
 
Join Date: Nov 2006
Posts: 2
Default Re: Blend problem

OK, I named it wrong (is my unexperience with opengl-stuff), but I use the glBlendColor for Blending purposes. And I already use the glBlendFunc this way. I cannot disable blending, because then my application does not work correct anymore.
Here is a part of the code that I am using:

GLfloat cae[4];
glGetFloatv (GL_BLEND_COLOR, cae);
Log("cae=[%f,%f,%f,%f]\n",
cae[0],cae[1],cae[2],cae[3]);

glBlendColor(0.0, 0.0, 0.0, 0.9);

glGetFloatv (GL_BLEND_COLOR, cae);
Log("after glBlendColor: cae=[%f,%f,%f,%f]\n",
cae[0],cae[1],cae[2],cae[3]);

glEnable(GL_BLEND);

glBlendFunc(GL_CONSTANT_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);

glTranslated(the_view->left + 0.5, the_view->bottom + 0.5, 0.0);
glRasterPos2d (0.0, 0.0);

glDrawPixels(width, height, GL_BGRA, GL_UNSIGNED_BYTE, the_view->image);


Both loggings display an alpha value of 0.0 (all four values are 0.0),
so the glBlendColor has no effect. Therefore I see no picture after the
call to glDrawPixels, because glBlendFund is called with src=0 and dst=1;

This application works fine under Solaris, but on Linux it doesn't work anymore

Grtz.
JeroenH is offline   Reply With Quote