Problem w tym ze na narysowanie tekstu nie mam kodu jeszcze w c++, ale to co sie dzieje pomiedzy //-------------------------------------------------------------------- to twoje rysowanie.
teraz wystarczy dawac glvertex3f(x,y,0); x i y to wspolrzedne w pikselach zaczynajac od dolnego lewego rogu
glLoadIdentity();
tagRECT * drawRect = new tagRECT();
glPushAttrib(GL_DEPTH_TEST);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
// GetWindowRect(Panel1, drawRect);
glOrtho(0, FCOpenGL->ClientWidth, 0, FCOpenGL->ClientHeight, -1, 1);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
//--------------------------------------------------------------------
glColor4f(0.5,0.5,0.5,0.6);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glBindTexture(GL_TEXTURE_2D,SUN_TEXTURE);
glBlendFunc(GL_SRC_COLOR,GL_ONE_MINUS_SRC_COLOR);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex2i(0,0);
glTexCoord2f(0,1);
glVertex2i(0,FCOpenGL->ClientHeight);
glTexCoord2f(1,1);
glVertex2i(FCOpenGL->ClientWidth,FCOpenGL->ClientHeight);
glTexCoord2f(1,0);
glVertex2i(FCOpenGL->ClientWidth,0);
glEnd();
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
if ( whiteout == true) {
whitea = (GetTickCount()-whitetime) / 1000.0f;
// if (whitea > 0.74) whitea = 0.740f;
glColor4f(0.5,0.5,0.5,0.6);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glColor4f(whitea,whitea,whitea,1.0f-whitea);
glBlendFunc(GL_ONE,GL_ONE);
glBindTexture(GL_TEXTURE_2D,GAMMATEX);
glBegin(GL_QUADS);
glTexCoord2f(0,0);
glVertex2i(0,0);
glTexCoord2f(0,1);
glVertex2i(0,FCOpenGL->ClientHeight);
glTexCoord2f(1,1);
glVertex2i(FCOpenGL->ClientWidth,FCOpenGL->ClientHeight);
glTexCoord2f(1,0);
glVertex2i(FCOpenGL->ClientWidth,0);
glEnd();
glDisable(GL_TEXTURE_2D);
glDisable(GL_BLEND);
}
//whitetime = GetTickCount();
//--------------------------------------------------------------------
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glPopAttrib();
delete drawRect;