jtsiomb / libdrawtext

Simple library for fast anti-aliased text rendering in OpenGL
GNU Lesser General Public License v3.0
86 stars 13 forks source link

glBlendFunc override #11

Open midn1 opened 5 years ago

midn1 commented 5 years ago

I suggest that glBlendFunc be removed from the GL backend, I came across a case where I had to use my own blending function, I found this to be a bit limiting.

(Yes, I can edit the source, and that's what I did, but it's still worthy to discuss).

jtsiomb commented 5 years ago

Interesting point, but the solution can't be for the blend function setup to be removed. The common case requires it, and it would be silly (not to mention backwards incompatible) to suddenly require the application to set up blending before calling drawtext rendering.

I will think about this. Maybe a setting through dtx_set, although that sounds a bit clunky... But for now you can do exactly what you need by using the user-supplied drawing mechanism. See examples/userdraw/userdraw.c for an example of this.

I'm marking this as a feature request.

midn1 commented 5 years ago

Alright. By the way, the case I needed was to invert the colors (so glBlendFuncSeparate).