I've been using the png_to_texture and draw_textured_quad fonction from this tutorial -> http://dcemulation.org/?title=Loading_P ... L_textures and I can't seem to get any apha to work.
my "main" code looks like this,
Code: Select all
int main()
{
//This is the GL init for the GL PNG exemple
glKosInit();
glScalef(1.f/320.f, 1.f/240.f, 1.f);
//this image has alpha
int ret = png_to_gl_texture(&t, "/rd/face_2.png");
//this image has no alpha channel
png_to_gl_texture(&bg, "/rd/grid.png");
////////////////////////////////
//Debug info for images
setParam(1, "f2=");
setInt(1, t.format);
setParam(2, "bg=");
setInt(2, bg.format);
//glClearColor(0.0f, 1.0f, 0.0f, 0.0f); // Clear The Background Color To Black
//glClearDepth(1.0); // Enables Clearing Of The Depth Buffer
glDisable(GL_DEPTH_TEST);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATEALPHA);
while(1)
{
updateCont();
draw_textured_quad(&bg, -256, 0);
draw_textured_quad(&t, tPos[0], tPos[1]);
glutSwapBuffers();
debugScreen();
}
return(0);
}
I can get all my image to show up if glEnable(GL_BLEND) is commented out.
if it's active, I can only get the bg (no alpha channel) image to show up, the one with alpha is completely invisible
any inputs?