Black border on texture

I have created a radial distortion algorithm in a Fragment Shader that distorts my 2D texture. But, when it distorts, the edges of the texture are streteched inward creating “streaking”. I’d like this to be black… I’m thinking that putting a black border on the texture would work. But, I can’t figure out how to put a black border on the texture.

Right now, I’m using gluBuild2DMipmaps since my image is not 2^n and when I try and scale it myself using gluScaleImage it comes out very choppy. Is there a way to add a black border to my texture using gluBuild2DMipmaps?


Maybe just use texture borders ?
Specify a one pixel wide border with glTexture2D call, set GL_CLAMP_TO_BORDER or something like that, and GL_TEXTURE_BORDER_COLOR to black.

Allright, but texture border (texels) and texture border color are mutually exclusive.
The texunit can only sample either one and then the texture border color set to black is the easier way here.
Some hardware does not support CLAMP_TO_BORDER.