0

im trying to draw a glowing texture and after reading this post: Opengl ES 1.x glowing effect in iOS. I have used this glBlendEquationOES(GL_MAX_EXT) command which makes the effect i wanted but the problem is it makes everything else corrupted. i wonder how can i disable glBlendEquationOES(GL_MAX_EXT) after i use it? or return it to default mode? Thanks! Guy.

Community
  • 1
  • 1

2 Answers2

0

You disable blending by... disabling blending. You enabled blending by calling glEnable(GL_BLEND). So turning it off means calling glDisable(GL_BLEND).

The blend equation/funcs can remain as you want. You don't have to set them to default or to any particular value. Disabling blending means that their values are irrelevant.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • I forgot to mention that im using cocos2d engine and by calling glDisable(GL_BLEND) it messed up the drawing made by cocos2d, stuff like CCSPrite and CCParticles, i used stefan solution and found that GL_FUNC_ADD_OES value is the "default" value for glBlendEquationOES. thank you all for the help, i have only basic opengl knowledge :) – steve88 Apr 14 '12 at 09:17
0

Have you tried saving and restoring the graphics state?

CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSaveGState(context);

// graphics state corrupting code ...

CGContextRestoreGState(context);
bshirley
  • 8,217
  • 1
  • 37
  • 43