Text Function Between 2D functions

Started by
0 comments, last by CRACK123 18 years, 10 months ago
When i put my text rendering code between my two functions which enable and disable 2D drawing, my text doesnt appear. here is the code for my text function:


void GLPrintString(unsigned int Font, char *str)
{
	if ((Font == 0) || (str == NULL))
	return;

	glPushAttrib(GL_LIST_BIT);
		glListBase(Base - 32);
		glCallLists(strlen(str), GL_UNSIGNED_BYTE, str);
	glPopAttrib();
}



And my 2D drawing functions:

void GLEnable2D(long ScreenResX, long ScreenRezY)
{
   int vPort[4];

   glGetIntegerv(GL_VIEWPORT, vPort);

   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
   glLoadIdentity();

   glOrtho(0, ScreenResX, ScreenRezY, 0, -10, 10); 
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
   glLoadIdentity();
}

void GLDisable2D()
{
   glMatrixMode(GL_PROJECTION);
   glPopMatrix();
   glMatrixMode(GL_MODELVIEW);
   glPopMatrix();
}


Any help would be REALY appreciated, the sooner i get this working, the sooner i can start major work on my game =D.
Advertisement
Are you setting the position of the text.

GLEnable2D(400, 400);glRasterPos2f(50, 50);GLPrintString(...);GLDisable2D();


Also check if it works using gluOrtho2D(...). Because I am not sure of your glOrtho call.
The more applications I write, more I find out how less I know

This topic is closed to new replies.

Advertisement