![]() ![]() glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, 16, 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, buffer ) Update: I think I solved it, thanks to the answers below. This question may be similar, but so far I am unable to apply the brief answer to my current problem. Why is the quad black instead of transparent, any how can I fix my code to draw what I was expecting? The X pattern I expected to be transparent too: The cheese has transparent holes, which show the photo and background behind it. The photo and cheese are both loaded from PNG images. The color for each vertex is white with full alpha. The textures are drawn as quads using glBegin/glEnd. GlTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ) ![]() GlTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ) GlTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA8, 16, 16, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, buffer ) GlBindTexture( GL_TEXTURE_2D, texture_id ) GlBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |