Archived

This topic is now archived and is closed to further replies.

khakionion

Ortho view...

Recommended Posts

Alright, I''ve looked through the gametutorials.com and NeHe tutorials, but haven''t been able to see what I''ve done wrong. I''ve got some text being displayed (it''s an outline font), and then a cursor for my mouse being displayed in Ortho mode. Once I "activate" ortho mode, though, the cursor fails to show up. However, if I comment out the function call that prints the font, the cursor shows up just fine!! It''s starting to bug me, here''s some code:
void Render()
{

	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
	glLoadIdentity();

	gluLookAt(0, 0, 2, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0);
	
	glDisable(GL_TEXTURE_2D);

	glColor3f(1.0f,1.0f,0.0f);

	PrintOutlineString(FontBase, "This is merely a test.  Disregard.");

	glMatrixMode(GL_PROJECTION);
	glPushMatrix();
	glLoadIdentity();
	glOrtho(0,viewX,0,viewY,0,1);
	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	
	glDisable(GL_DEPTH_TEST);

	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D,MouseTexture);
	


	glBegin(GL_QUADS);
		glColor3f(1.0,0.0,0.0);
		
		glTexCoord2f(0,0);
		glVertex2f(mouseX,mouseY);

		glTexCoord2f(1,0);
		glVertex2f(mouseX+CURSORSIZE,mouseY);

		glTexCoord2f(1,1);
		glVertex2f(mouseX+CURSORSIZE,mouseY+CURSORSIZE);

		glTexCoord2f(0,1);
		glVertex2f(mouseX,mouseY+CURSORSIZE);
	glEnd();

	glMatrixMode(GL_PROJECTION);
	glPopMatrix();
	glMatrixMode(GL_MODELVIEW);

	glFlush();

	SwapBuffers(g_HDC);
} 
Any help would be greatly appreciated! ------- Love conquers all....except CANCER

Share this post


Link to post
Share on other sites
I think it has something to do with my PrintOutlineString function...could the fact that it''s calling a display list change it''s ability to render in ortho?
void PrintOutlineString(unsigned int base, char * str)
{
float length = 0;
int idx;

glPushAttrib(GL_LIST_BIT);
glListBase(base);
glCallLists(strlen(str), GL_UNSIGNED_BYTE, str);
glPopAttrib();
}


-------
Love conquers all....except CANCER

Share this post


Link to post
Share on other sites
Okay, if I render something in perspective mode that doesn''t use display lists, then everything works just fine. So...am I calling the display list correctly? What in that PrintOutlineString function is making the other objects mess up?

-------
Love conquers all....except CANCER

Share this post


Link to post
Share on other sites