{
struct stat buf;
if (stat(fname, &buf) == -1) {
- _status = ERROR;
+ _status = e_ERROR;
return FNT_FALSE;
}
_name = fname;
bool SafeTexFont::ensureTextureLoaded()
{
- if (_status != ERROR) {
- if (_status == LOADED) {
+ if (_status != e_ERROR) {
+ if (_status == e_LOADED) {
return true;
} else {
int loadStatus = fntTexFont::load(_name.c_str(), _mag, _min);
if (loadStatus == FNT_TRUE) {
- _status = LOADED;
+ _status = e_LOADED;
return true;
} else {
- _status = ERROR;
+ _status = e_ERROR;
_error = ulGetError();
return false;
}
class SafeTexFont : public fntTexFont
{
public:
- SafeTexFont() : _status(NOT_LOADED) {}
+ SafeTexFont() : _status(e_NOT_LOADED) {}
/** Load the texture for this font.
* @param mag OpenGL texture magnification; default is GL_NEAREST
* @param min OpenGL texture minification; default is
void puts(sgVec3 curpos, float pointsize, float italic, const char *s);
enum FontStatus
{
- ERROR = -1,
- NOT_LOADED = 0,
- LOADED = 1
+ e_ERROR = -1,
+ e_NOT_LOADED = 0,
+ e_LOADED = 1
};
FontStatus getStatus() { return _status; }
std::string& fntError() { return _error; }