PDA

View Full Version : Problem with selection



jirkamelich
12-30-2002, 01:55 AM
I draw this 2D Font :

glColor3ub(40,255,40);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(0,400,0,300);
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
//--
glRasterPos2f(200,150);
Print2DFont("some text");
//--
glPopMatrix();
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);

The text is drawn well,
but then i do this :

glInitNames();
glPushName(0);
glBindTexture(GL_TEXTURE_2D,TextureBin [5]);
glPushMatrix();
glTranslatef(0.2,0,0);
glLoadName(1);
glCallList(square);
glPopMatrix();

but the selection doesnt work, when i draw the text before it, otherwise its all ok.
Does somebody know why doesnt it work, or some example, i need to draw something with gluOrtho2D a use name.
Thanks Jirka