PDA

View Full Version : Image dissaperence



answerme
11-07-2009, 03:09 AM
Hye all Iam new to OPEN GL I am facing a problem with my image.
Actually I have 3 systems & communication SYSTEM A ,B with C through socket programming.If Iam sending data from system A to SYStem C Iam able to see the picture continously But when Iam send data from SYSTEM B (SYSTEM A STILL CONNECTED WITH SYSTERM C)my system A image goes invisible then afterwards it becomes visible & keep on happening same process contiuously.
I am forwarding my code


void Scenario::OnPaint()
{
CPaintDC dc(this);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glClearColor(1.0,1.0,1.0,1.0);
glClearDepth(1.0f) ;
glColor4f(1.0f, 1.0f, 1.0f, 0.50f) ;
glPushMatrix() ;
glTranslatef( 0.0f, 0.0f, -99.0f) ;
m_objTexture.Use() ;
glEnable(GL_TEXTURE_2D) ;
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glBegin(GL_QUADS);
glTexCoord2f(0.0,1.0) ;
glVertex3f(0.0f, (float)m_WndHeight, -1) ;
glTexCoord2f(1.0,1.0) ;
glVertex3f((float)m_WndWidth ,(float)m_WndHeight, -1) ;
glTexCoord2f(1.0,0.0) ;
glVertex3f((float)m_WndWidth, 0.0f, -1) ;
glTexCoord2f(0.0,0.0) ;
glVertex3f(0.0f, 0.0f, -1) ;
glEnd() ;
glDisable(GL_TEXTURE_2D) ;
glPopMatrix() ;
glPushMatrix() ;
glEnable(GL_TEXTURE_2D);
if(m_objDocument == NULL)
return ;
if(upwin)
{
DrawDiscAndLoad();
}
glPopMatrix() ;
SwapBuffers(dc);

}



void Scenario::DrawDiscAndLoad()
if(entity>0)
{
glPushMatrix();
glTranslatef(0.0f, 0.0f, -100);

----some code-----

glPopMatrix() ;
}
if(land>0)
{
glPushMatrix();
glTranslatef(0.0f, 0.0f, -100);

----some code-----

glPopMatrix() ;
}

}

I hope this will help somewhat to understand my mistake
Waiting for Reply