In one of my latest projects, I'm having some difficulty trying to get large tiles to zoom in and out, yet stay next to one another without a noticeable seam.

At first I thought it had to do with lack of precision, then I noticed some 'glitchy-ness' with the floating point values I was using. Then I got curious and I tried to flat out overlap them on purpose. What I found out blew my mind. There was a black seam even though it should have in theory just be the texture overlapped over the other.

So what am I doing or not doing wrong here?

I am using OpenGL in Ortho mode, and here is my function that I use to do this...

[pascal]procedure DrawMap_Seamless(X, Y, SrcWidth, SrcHeight, DestWidth, DestHeight: Real; Texture: TTexture);
var
texX, texY : Real;
begin
glEnable(GL_TEXTURE_2D); //Enable Texturing
glBindTexture(GL_TEXTURE_2D, Texture.ID); //Bind Texture

glDisable(GL_BLEND);
glEnable(GL_ALPHA_TEST); //Enable Alpha (Transparency) (Uses Texture Alpha channel)
glAlphaFunc(GL_GREATER, 0.1); //Set Alpha settings

glColor3f(1, 1, 1); //Make sure color is white (Normal)

BeginOrtho; //Switch to 2D mode
glPushMatrix; //Save Current Matrix
glTranslatef(X, Y, 0); //Move to Objects location

texX := SrcWidth / Texture.Width;
texY := SrcHeight / Texture.Height;

glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2f(0, 0);

glTexCoord2f(texX, 0);
glVertex2f(DestWidth, 0);

glTexCoord2f(texX, texY);
glVertex2f(DestWidth, DestHeight);

glTexCoord2f(0, texY);
glVertex2f(0, DestHeight);
glEnd;

glPopMatrix; //Reload Old Matrix
EndOrtho;
end;
[/pascal]

Now here is the code I use to draw my wonderful (2048x2048 32-bit png imported texture) map...

[pascal] // Draw Map
if (ScreenX <ScreenWidth> MapWidth - ScreenWidth / MapZoom / 2) then
DrawMap_Seamless((-ScreenX * MapZoom + (MapTex[0].Width * MapZoom) + (MapTex[1].Width * MapZoom)) + ScreenWidth / 2,
(-ScreenY * MapZoom) + ScreenHeight / 2,
MapTex[0].Width, MapTex[0].Height,
(MapTex[0].Width * MapZoom),
(MapTex[0].Height * MapZoom),
MapTex[0]);[/pascal]

ScreenX, ScreenY are the map scroll position offsets.
MapTex[] is obviously my array of TTexture objects (just the 2; 0 and 1) TTexture.ID is where I store the GL texture number.
MapZoom is obviously the current zoom size that I'm currently using.

So how do I get rid of this annoying black seam?

I can post a demo if it's needed.