how to reset glBlendFunc?. I thought to reset that with push popmatrix?
Edited by mike44, 26 February 2017 - 11:38 AM.
We get it. We use ad blockers too. But GameDev.net displays them so we can continue to be a great platform for you.
Please whitelist GameDev.net and our advertisers.
Also consider a GDNet+ Pro subscription to remove all ads from GameDev.net.
Jump to content
OpenGL API Specifications
Subscribe to GameDev.net's newsletters to receive the latest updates and exclusive content.
Posted 26 February 2017 - 05:48 PM
Use ::glDisable( GL_BLEND ) to disable it.
Use ::glBlendFunc( GL_ONE, GL_ZERO ) to set it back to the OpenGL default.
Edited by L. Spiro, 26 February 2017 - 05:48 PM.
Posted 27 February 2017 - 01:43 PM
The default blend state is blending disabled and src GL_ONE, dst GL_ZERO.
However, I would recommend that you not reset the blendfunc (or indeed any other state) after drawing. Instead you should explicitly set all of the state you want before drawing. Add state filtering if performance bothers you. This way your draw calls get to be more robust by not having dependencies on or assumptions about previously set state.
It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC.