|
custom consumer patch: How to access blending options ?Hi, i didn't find any valuable example on how to enable the blending port on a custom consumer plugin. Adding something like: glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA,GL_ONE); doesn't seem to change anything. (even if glColor has some alpha value) Any tips would be greatly appreciated ... even a link to some plugin's source> thxx (official API)
|
I don't know the answer, but i think vade's plugins sources are good starting points ;-)
here's gltools:
you can't use the port directly in the official api (of course), but if you make it an index port with 0-3, here's what the built-in stuff does:
0: (doesn't call glBlendFunc) (replace) 1: GL_ONE, GL_ONE_MINUS_SRC_ALPHA (over) 2: GL_ONE, GL_ONE (add) 3: GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA (alpha -- gltools adds this)
Be sure to store the old values (glGetInteger) and restore them when you're done, or things get crazy (since replace doesn't set it explicitly, it'll use any stale blend mode that isn't reset)