Allow font unloading
This was SVN commit r734.
This commit is contained in:
parent
4a9b08928a
commit
dccdd0c747
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user