1
0
forked from 0ad/0ad

Allow font unloading

This was SVN commit r734.
This commit is contained in:
Ykkrosh 2004-07-12 20:08:34 +00:00
parent 4a9b08928a
commit dccdd0c747
2 changed files with 11 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
$Id: unifont.cpp,v 1.5 2004/07/11 20:29:34 olsner Exp $
$Id: unifont.cpp,v 1.6 2004/07/12 20:08:34 philip Exp $
Unicode OpenGL texture font
@ -81,7 +81,7 @@ static int UniFont_reload(UniFont* f, const char* fn, Handle h)
FNTStream >> f->LineSpacing;
f->ListBase = glGenLists(NumGlyphs);
assert(f->ListBase != 0); // My Voodoo2 drivers didn't support display lists
assert(f->ListBase != 0); // My Voodoo2 drivers didn't support display lists (although I'd be surprised if they got this far)
for (int i = 0; i < NumGlyphs; ++i)
{
@ -125,6 +125,11 @@ Handle unifont_load(const char* fn, int scope)
}
int unifont_unload(Handle& h)
{
return h_free(h, H_UniFont);
}
int unifont_bind(const Handle h)
{
H_DEREF(h, UniFont, f);

View File

@ -1,4 +1,4 @@
// $Id: unifont.h,v 1.2 2004/06/16 16:29:38 philip Exp $
// $Id: unifont.h,v 1.3 2004/07/12 20:08:34 philip Exp $
#ifndef __UNIFONT_H__
#define __UNIFONT_H__
@ -11,6 +11,9 @@
// in fn+".fnt" with texture fn+".tga"
extern Handle unifont_load(const char* fn, int scope = RES_STATIC);
// Release a handle to a previously loaded font
int unifont_unload(Handle& h);
// Use the font referenced by h for all subsequent glwprintf() calls.
// Must be called before any glwprintf().
extern int unifont_bind(Handle h);