A
download text.h
Language: C++
LOC: 20
Project Info
TableHockey3D(tablehockey)
Server: SourceForge
Type: cvs
...ey\CVSROOT\tablehockey\src\
   Application.cpp
   Application.h
   Camera.cpp
   Camera.h
   Cube.cpp
   Cube.h
   Data.cpp
   Data.h
   Disk.cpp
   Disk.h
   FloatingText.cpp
   FloatingText.h
   Floor.cpp
   Floor.h
   Input.cpp
   Input.h
   Light.cpp
   Light.h
   log.cpp
   log.h
   main.cpp
   mmgr.cpp
   mmgr.h
   Model.cpp
   Model.h
   nommgr.h
   Puck.cpp
   Puck.h
   Pyramid.cpp
   Pyramid.h
   scene.cpp
   scene.h
   SmartPtr.h
   Sound.cpp
   Sound.h
   TableHockey.dsp
   TableHockey.dsw
   TestScene.cpp
   TestScene.h
   text.cpp
   text.h
   TextHelp.cpp
   TextHelp.h
   texture.cpp
   texture.h
   TexturedCube.cpp
   TexturedCube.h
   timer.cpp
   timer.h
   View.cpp
   View.h

/*=============================================================================
	text.h: Basic OpenGL Framework text implementation class

Revision history:
	* Created by Zack Smith October 9, 2000
=============================================================================*/

#if !defined(TEXT_H__INCLUDED_)
#define TEXT_H__INCLUDED_

#include <gl\glu.h>
#include <gl\glaux.h>

#include "texture.h"

/**
 * Nice class to show text in an OpenGL window.
 *
 * You should derive your own class and add a "Draw()" function so 
 * you can update your text-object just like any other model. Check
 * "CFloatingText" for an example.
 *
 * @see CFloatingText
 */
class CText
{
public:
	/// constructor
	CText();
	/// destructor
	~CText();

	/** 
	 * Create a new font using "CreateFont()" of the Win32-api.
	 *
	 * @param szFontFace Name of the font
	 * @param iSize Size of the font
	 * @param fnWeight Weight of the font: FW_NORMAL, FW_BOLD etc (check the 
	 * Win32 "CreateFont()" function for more values)
	 */
	void BuildFont(char *szFontFace = "Courier New", int iSize = 12, int fnWeight = FW_NORMAL);
	/**
	 * Load a front from a bitmap
	 * @param szTexture Filename of the bitmap with the font data
	 */
	int LoadFont(char* szTexture);
	/// Print a string to the screen just like printf, (0,0) is bottom left!
	GLvoid glPrint(const char *fmt, ...);                    // Custom GL "print" routine
private:
	GLuint	base;				// Base Display List For The Font
	HFONT	hFont;
	GLYPHMETRICSFLOAT gmf[256];	// Storage For Information About Our Outline Font Characters
	CTexture *pTexture;
};

#endif

/*-----------------------------------------------------------------------------
	The End.
-----------------------------------------------------------------------------*/

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us