Jump to content
  • Advertisement

Archived

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

Galileo430

OGL Font Problem.

This topic is 6378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Could you guys quickly check this code over for major errors. Cause I can''t get it to work. It''s driveing me nuts. All variables are defined. I included some in comments at the top.
  
// GLuint dwBaseFont;


void LoadFont(char *szFontName)
{
	//-----------------------//

	// Locals				

	//-----------------------//

	HFONT	hFont;

	//----------------------//

	// Generate List		//

	//----------------------//

	dwBaseFont = glGenLists(256);

	hFont = CreateFont(-24, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, 
						ANSI_CHARSET, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS,
						ANTIALIASED_QUALITY, FF_DONTCARE|DEFAULT_PITCH,
						szFontName);


	SelectObject(hdc,hFont);
	wglUseFontBitmaps(hdc, 0, 256, dwBaseFont);
}

void glPrint(char *szString)
{
	if (szString == NULL)						
		return;									

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

	glPushAttrib(GL_LIST_BIT);				
		glListBase(dwBaseFont);
		glRasterPos2i(0,0);
		glCallLists(strlen(szString), GL_UNSIGNED_BYTE, szString);
	glPopAttrib();							
}
  
I don''t get anything on the screen when I call glPrint and swap the buffers.

Share this post


Link to post
Share on other sites
Advertisement
If you don''t have proper hardware support for OpenGL you may get problems using raster functions in fullscreen mode - try running the app in a window. There is a way around this, I hear, but I got a GeForce2 instead of bothering to find out what it was. I think the solution may be buried somewhere in one of the NeHe tutorials.

Geocyte Has Committed Suicide.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!