Use glBlendFuncSeparate for alpha masking in tex.c
The draw happens in two steps:
1. Copy the alpha mask to the framebuffer without changing the color
channels: glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_ONE, GL_ZERO)
This uses GL_LINEAR filtering and GL_CLAMP_TO_BORDER to create a
alpha mask with hard edges as opposed to blurred edges.
2. Copy the texture color to the framebuffer using the alpha mask
stored in the frame buffer as the mask:
glBlendFuncSeparate(GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, GL_ZERO, GL_ZERO);
We can turn on GL_LINEAR filtering and GL_CLAMP here because the
alpha mask is taken from the framebuffer instead of the filtered
alpha component of the texture.
This creates a nice looking image without having to do any fancy setup.
The previous version also has issues if the texture is not split in the
middle of the polygon.
Unfortunately glBlendFuncSeparate depends on OpenGL 2.0 and requires
twice as many draws.