aboutsummaryrefslogtreecommitdiff
path: root/Source/Text.cpp
diff options
context:
space:
mode:
authorzakk <zakk@5198baeb-e213-0410-be47-fc2ff85ca46f>2008-02-12 23:19:39 +0000
committerzakk <zakk@5198baeb-e213-0410-be47-fc2ff85ca46f>2008-02-12 23:19:39 +0000
commit93c589034b80253f9653b192eda2a882f311c80b (patch)
tree354b22a2338d4d24047e417c574f7d565d56dba7 /Source/Text.cpp
parent76ec0c3729dc9e8808a5db339148ad7454105537 (diff)
downloadblackshades-93c589034b80253f9653b192eda2a882f311c80b.tar.gz
PNG patch from Victor Eremin (ErV2005@rambler.ru)
git-svn-id: svn://svn.icculus.org/blackshades/trunk@107 5198baeb-e213-0410-be47-fc2ff85ca46f
Diffstat (limited to 'Source/Text.cpp')
-rw-r--r--Source/Text.cpp28
1 files changed, 2 insertions, 26 deletions
diff --git a/Source/Text.cpp b/Source/Text.cpp
index 2b64b4b..2c2323a 100644
--- a/Source/Text.cpp
+++ b/Source/Text.cpp
@@ -1,34 +1,10 @@
/**> HEADER FILES <**/
#include "Text.h"
+#include "Textures.h"
void Text::LoadFontTexture(char *fileName)
{
- TGAImageRec *tempTexture;
- GLuint type;
-
- //Load Image
- tempTexture = LoadTGA( fileName );
- //Is it valid?
- if(tempTexture){
- //Alpha channel?
- if ( tempTexture->bpp == 24 )
- type = GL_RGB;
- else
- type = GL_RGBA;
-
- glPixelStorei( GL_UNPACK_ALIGNMENT, 1 );
-
- glGenTextures( 1, &FontTexture );
- glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE );
-
- glBindTexture( GL_TEXTURE_2D, FontTexture);
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
- glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
-
- gluBuild2DMipmaps( GL_TEXTURE_2D, type, tempTexture->sizeX, tempTexture->sizeY, type, GL_UNSIGNED_BYTE, tempTexture->data );
- free( tempTexture->data );
- free( tempTexture );
- }
+ FontTexture = loadTexture(fileName);
}
void Text::BuildFont() // Build Our Font Display List