Changeset 440 for trunk/src/lib


Ignore:
Timestamp:
07/23/15 21:16:01 (10 years ago)
Author:
epyon
Message:
  • massive std::string removal
  • no header depends on std::string anymore (or any other STL header)
  • still some code files do (WIP)
  • massive refactoring where std::string was used
  • lua still messy (grep for string128 - used everywhere)
  • string_twine added
File:
1 edited

Legend:

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

    r406 r440  
    5656
    5757
    58 static void* load_gl_ext_symbol_impl( const char* name, nv::log_level fail_level = nv::LOG_DEBUG )
    59 {
    60         void* result = gl_ext_loader( name );
     58static void* load_gl_ext_symbol_impl( const nv::string_view& name, nv::log_level fail_level = nv::LOG_DEBUG )
     59{
     60        void* result = gl_ext_loader( name.data() );
    6161        NV_LOG( ( result ? nv::LOG_DEBUG : fail_level ), "load_gl_ext_symbol : ", name, ( result ? " succeded." : "failed." ) );
    6262        return result;
    6363}
    6464
    65 static void* load_gl_ext_symbol( const char* name, bool iterate, const char* ext )
     65static void* load_gl_ext_symbol( const nv::string_view& name, bool iterate, const nv::string_view& ext )
    6666{
    6767        void * result        = nullptr;
    68         result = load_gl_ext_symbol_impl( ext ? ( std::string(name) + ext ).c_str() : name );
     68        nv::string128 test_name = name + ext;
     69        result = load_gl_ext_symbol_impl( !ext.empty() ? test_name : name );
    6970        if ( result ) return result;
    7071        if ( iterate )
    7172        {
    72                 result = gl_ext_loader( (std::string(name) + "ARB").c_str() );
     73                test_name = name + "ARB"_ls;
     74                result = gl_ext_loader( test_name.data() );
    7375                if ( result ) return result;
    74                 result = gl_ext_loader( (std::string(name) + "EXT").c_str() );
     76                test_name = name + "EXT"_ls;
     77                result = gl_ext_loader( test_name.data() );
    7578                if ( result ) return result;
    7679        }
     
    255258
    256259#       define NV_GL_FUN_EXT( rtype, symbol, fparams ) \
    257         void_assign( symbol, load_gl_ext_symbol(#symbol, true, nullptr) ); \
     260        void_assign( symbol, load_gl_ext_symbol(#symbol, true, string_view()) ); \
    258261        count++; if ( !symbol ) fail_count++;
    259262
Note: See TracChangeset for help on using the changeset viewer.