java - Drawing with transparent texture, then opaque color -


i initialize opengl make transparent textures transparent:

glenable(gl_blend); glblendfunc(gl_src_alpha, gl_one_minus_src_alpha); 

i draw texture this:

glpushmatrix();     //translate     //neutralize colors     //bind texture     //vertex points glpopmatrix(); 

but when try draw quad afterwards, won't show up:

glpushmatrix(); {     gltranslatef(x, y, 0);     glcolor3f(1f, 0f, 0f);     glbegin(gl_quads);     {                    glvertex2f(0, 0);         glvertex2f(10, 0);         glvertex2f(10, 10);         glvertex2f(0, 10);     }     glend(); } glpopmatrix(); 

if remove initialization above, quad appears, texture no longer transparent.

what doing wrong here?

edit: should call gldisable(gl_blend); whenever want draw not texture?

you need disable blending before drawing quad.

edit: can post more code? problem may somewhere else, example if have not disabled texture before drawing quads.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -