texture problem

I am using 2 texture to apply on 2 diff. rectangles in my scene .

In starting i generate one texture , bind it and set env. variables and fill it with black pixels and then second texture and do the same thing . now I have another function loadFrame which i use to load texture using glTexSubImage() and before that i bind to the required texture . I am loading only one of the two textures but when i draw the polygon (used glBindTexture) both polygon have same texture the one i loaded while i think the second polygon should have black texture …

here is the code fragment …

void CPLCOpenGLEngine::initializeTexture()
{
CPUInt8 in1 = (CPUInt8 )calloc(m_presentationTextureWidthm_presentationTextureHeight4,sizeof(CPUInt8*));
glGenTextures(1, &m_presentationTexture);
glEnable(GL_TEXTURE_2D);
GLclampf priority = 1.0;
//glPrioritizeTextures(1,&m_presentationTexture,&priority);
glBindTexture( GL_TEXTURE_2D, m_presentationTexture );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST); //change GL_LINEAR to GL_NEAREST to improve performance , quality will be reduced .
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); //change GL_LINEAR to GL_NEAREST to improve performance , quality will be reduced .
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,GL_REPEAT );
glTexImage2D(GL_TEXTURE_2D,0,4,m_presentationTextureWidth,m_presentationTextureHeight,0,GL_BGRA_EXT,GL_UNSIGNED_BYTE,in1);
free(in1);

CPUInt8 *in2 = (CPUInt8 *)calloc(m_presenterTextureWidth*m_presenterTextureHeight*4,sizeof(CPUInt8*));
glGenTextures(1, &m_presenterTexture);
glEnable(GL_TEXTURE_2D);
priority = 1.0;
//glPrioritizeTextures(1,&m_presenterTexture,&priority);
glBindTexture( GL_TEXTURE_2D, m_presenterTexture );
glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,GL_NEAREST);			//change GL_LINEAR to GL_NEAREST to improve performance , quality will be reduced .
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );		//change GL_LINEAR to GL_NEAREST to improve performance , quality will be reduced .
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,GL_REPEAT );
glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T,GL_REPEAT );
glTexImage2D(GL_TEXTURE_2D,0,4,m_presenterTextureWidth,m_presenterTextureHeight,0,GL_BGRA_EXT,GL_UNSIGNED_BYTE,in2);
free(in2);

}

void CPLCOpenGLEngine::loadFrame(FrameName name,CPUInt8* in)
{

if(name == ePresenterFrame)
{
	glBindTexture(GL_TEXTURE_2D, m_presenterTexture);
	glTexSubImage2D(GL_TEXTURE_2D,0,0,0,m_presenterWidth,m_presenterHeight,GL_BGRA_EXT,GL_UNSIGNED_BYTE,in);
}
else if(name == ePresentationFrame)
{
	glBindTexture(GL_TEXTURE_2D , m_presentationTexture);
	glTexSubImage2D(GL_TEXTURE_2D,0,0,0,m_presentationWidth,m_presentationHeight,GL_BGRA_EXT,GL_UNSIGNED_BYTE,in);
}
error = glGetError();

}

void CPLCOpenGLEngine::display()
{
glClear(GL_COLOR_BUFFER_BIT);
glCallList(m_setup);

glCallList(m_drawListPresentation);
glCallList(m_drawListPresentationSmall);
glBindTexture(GL_TEXTURE_2D , m_presenterTexture);
glCallList(m_drawListPresenter);
glCallList(m_drawListPresenterSmall);
error = glGetError();
glFlush();
SwapBuffers(hDC);

}

Please use [ code]/[ /code] tags around posted source code.

You never unbind the texture or disable texturing, so if display gets called a second time the texture is still bound and will be used for everything in CPLCOpenGLEngine::display().