src/font.cpp

Go to the documentation of this file.
00001 /* Crown and Cutlass
00002  * Font Creation / Use Code
00003  */
00004 
00005 #include <cstdio>
00006 #include <string>
00007 #include <cstdarg>
00008 #include "GLee.h"
00009 #include <GL/glu.h>
00010 #include "Log.h"
00011 #include "Texture.h"
00012 #include "font.h"
00013 
00014 using namespace std;
00015 
00016 void EnterTextMode(int width, int height) {
00017   glMatrixMode(GL_PROJECTION);
00018   glLoadIdentity();
00019 
00020   gluOrtho2D(0, width, height, 0);
00021 
00022   glMatrixMode(GL_MODELVIEW);
00023   glLoadIdentity();
00024 
00025   glBlendFunc(GL_SRC_ALPHA, GL_ONE);
00026   glEnable(GL_TEXTURE_2D);
00027   glEnable(GL_BLEND);
00028   glDisable(GL_LIGHTING);
00029   glDisable(GL_DEPTH_TEST);
00030   glDisable(GL_CULL_FACE);
00031 }
00032 
00033 void ExitTextMode() {
00034   glEnable(GL_LIGHTING);
00035   glEnable(GL_DEPTH_TEST);
00036   glEnable(GL_CULL_FACE);
00037   glDisable(GL_BLEND);
00038 }

Generated on Mon Jan 8 22:34:12 2007 for CrownandCutlass by  doxygen 1.4.7