glColor4f(Red, Green, Blue, 0.75);
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glPushMatrix();
XPLMBindTexture2d(gTexture[GAUGE_TEXTURE], 0);
glBegin(GL_QUADS);
glTexCoord2f(1, 0.0f); glVertex2f(GaugeRight, GaugeBottom); // Bottom
Right Of The Texture and Quad
glTexCoord2f(0, 0.0f); glVertex2f(GaugeLeft, GaugeBottom); // Bottom
Left Of The Texture and Quad
glTexCoord2f(0, 1.0f); glVertex2f(GaugeLeft, GaugeTop); // Top Left
Of The Texture and Quad
glTexCoord2f(1, 1.0f); glVertex2f(GaugeRight, GaugeTop); // Top Right
Of The Texture and Quad
glEnd();
glPopMatrix();
glFlush();
> HI
> I tried that below in vain but how can I show a *.bmp texture
> file with transparent regions?
The official BMP specification doesn't include a alpha channel,
(though it would be possible to include one). So just don't use
BMP. Use a file format, which supports an alpha channel. There
are plenty to choose from:
PNG, TGA, OpenEXR
JPEG does not provide an alpha channel.
Wolfgang Draxinger
--
E-Mail address works, Jabber: hexa...@jabber.org, ICQ: 134682867
Would my code work with PNG or would I need to make some changes? (
apart the png loading ) Alpha blending etc.?
Michael
Consider the texture envornment & what you want to do:
The default texture environment is GL_MODULATE, which multiplies the
texture color by the primitive (or lighting) color. Most applications that
use both OpenGL lighting and texture mapping use the GL_MODULATE texture
environment.
Look at GL_DECAL to GL_MODULATE, depending on what you want with texture
alpha & quad alpha (and color).
-jbw
You probably want glAlphaFunc() instead of blending.
--
<\___/>
/ O O \
\_____/ FTB.
Well, he is setting the background quad to .75 alpha, so I would assume he
does want blending.
jbw
Oh, yes...
Still he might want both. Rejecting pixels is never bad.
Anyone could send me all the png loading files. This could save me
apparently a lot of time.
bxcvs AT yahoo DOT com
THANKS
> So I downloaded libpng for windows but no zlib included not
> even mentioned. downloading some zlib header I get errors.
http://openil.sourceforge.net/
I had problem compiling the zlib with lines "movd mm_,[esp+_]" and
googling gave me the solution: you must add "dword ptr" this way "movd
mm_,dword ptr [esp+_]".
http://webnews.mt.net.mk/dnewsweb.exe?cmd=article&group=comp.graphics.api.opengl&item=35262&utag=