Changeset 25 for trunk/src


Ignore:
Timestamp:
05/18/13 11:34:30 (12 years ago)
Author:
melon
Message:

Modified thrown error messages to provide more details

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gl/texture_font.cc

    r24 r25  
    44// This file is part of NV Libraries.
    55// For conditions of distribution and use, see copyright notice in nv.hh
    6 
     6#include <sstream>
    77#include <stdexcept>
    88
     
    101101                FT_UInt glyph_index = FT_Get_Char_Index( face, c );
    102102                FT_Error error = FT_Load_Glyph( face, glyph_index, flags );
    103                 if ( error ) throw std::runtime_error( "FT_Error while loading glyphs" );
     103                if ( error )
     104                {
     105                        std::stringstream error_msg;
     106                        error_msg << "FT_Error while loading glyphs, error: "
     107                                << error << " code: " << c;
     108                        throw std::runtime_error( error_msg.str().c_str() );
     109                }
    104110
    105111                FT_GlyphSlot slot   = face->glyph;
     
    114120                if ( r.pos.x < 0 )
    115121                {
    116                         throw std::runtime_error( "Atlas full while loading glyphs" );
     122                        std::stringstream error_msg;
     123                        error_msg << "Atlas full while loading glyphs, "
     124                                << "r.pos.x: " << r.pos.x << " code: "
     125                                << c;
     126                        throw std::runtime_error( error_msg.str().c_str() );
    117127                }
    118128                r.size.x -= 1;
Note: See TracChangeset for help on using the changeset viewer.