Changeset 365 for trunk/src/sdl


Ignore:
Timestamp:
05/16/15 17:40:16 (10 years ago)
Author:
epyon
Message:
  • overhaul of logging: no longer stream operated no longer using STL no memory allocation shorthand macros fast file and console I/O
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:global-ignores set to
      vs2012
      vs2013
      gmake
      gmake-clang
  • trunk/src/sdl/sdl_audio.cc

    r330 r365  
    2121        if ( SDL_Init( SDL_INIT_AUDIO ) == -1 )
    2222        {
    23                 NV_LOG( LOG_CRITICAL, "SDL_AUDIO failed to load -- " << SDL_GetError() );
     23                NV_LOG_CRITICAL( "SDL_AUDIO failed to load -- ", SDL_GetError() );
    2424                return;
    2525        }
     
    2727        if( Mix_OpenAudio( 44100, MIX_DEFAULT_FORMAT, 2, 1024 ) == -1 )
    2828        {
    29                 NV_LOG( LOG_CRITICAL, "SDL_mixer failed to load -- " << Mix_GetError() );
     29                NV_LOG_CRITICAL( "SDL_mixer failed to load -- ", Mix_GetError() );
    3030                return;
    3131        }
     
    4040                if ( channel == -1 )
    4141                {
    42                         NV_LOG( LOG_WARNING, "SDL_mixer failed to play -- " << Mix_GetError() );
     42                        NV_LOG_WARNING( "SDL_mixer failed to play -- ", Mix_GetError() );
    4343                }
    4444                else
     
    6767                if ( channel == -1 )
    6868                {
    69                         NV_LOG( LOG_WARNING, "SDL_mixer failed to play -- " << Mix_GetError() );
     69                        NV_LOG_WARNING( "SDL_mixer failed to play -- ", Mix_GetError() );
    7070                }
    7171                else
     
    9191        if ( Mix_LoadWAV_RW == nullptr || SDL_RWFromFile == nullptr )
    9292        {
    93                 NV_LOG( LOG_ERROR, "SDL_mixer not loaded!" );
     93                NV_LOG_ERROR( "SDL_mixer not loaded!" );
    9494        }
    9595        Mix_Chunk *sample = Mix_LoadWAV_RW(SDL_RWFromFile(a_path.c_str(), "rb"), 1);
    9696        if ( sample == nullptr )
    9797        {
    98                 NV_LOG( LOG_ERROR, "SDL_mixer failed to load sample '" << a_path << "' -- " << Mix_GetError() );
     98                NV_LOG_ERROR( "SDL_mixer failed to load sample '", a_path, "' -- ", Mix_GetError() );
    9999                return sound();
    100100        }
  • trunk/src/sdl/sdl_window.cc

    r343 r365  
    3838        if ( m_handle == 0 )
    3939        {
    40                 NV_LOG( LOG_CRITICAL, "Video mode set failed: " << SDL_GetError( ) );
     40                NV_LOG_CRITICAL( "Video mode set failed: ", SDL_GetError( ) );
    4141                return; // TODO: Error report
    4242        }
     
    5656        if ( ctx_handle == 0 )
    5757        {
    58                 NV_LOG( LOG_CRITICAL, "GL Context creation failed: " << SDL_GetError( ) );
     58                NV_LOG_CRITICAL( "GL Context creation failed: ", SDL_GetError( ) );
    5959                return; // TODO: Error report
    6060        }
    6161
    6262        nv::load_gl_library();
    63         NV_LOG( LOG_INFO, "OpenGL Vendor       : " << glGetString(GL_VENDOR) );
    64         NV_LOG( LOG_INFO, "OpenGL Renderer     : " << glGetString(GL_RENDERER) );
    65         NV_LOG( LOG_INFO, "OpenGL Version      : " << glGetString(GL_VERSION) );
    66         NV_LOG( LOG_INFO, "OpenGL GLSL Version : " << glGetString(GL_SHADING_LANGUAGE_VERSION) );
     63        NV_LOG_INFO( "OpenGL Vendor       : ", (const char*)glGetString(GL_VENDOR) );
     64        NV_LOG_INFO( "OpenGL Renderer     : ", (const char*)glGetString( GL_RENDERER ) );
     65        NV_LOG_INFO( "OpenGL Version      : ", (const char*)glGetString( GL_VERSION ) );
     66        NV_LOG_INFO( "OpenGL GLSL Version : ", (const char*)glGetString( GL_SHADING_LANGUAGE_VERSION ) );
    6767        SDL_GL_SetSwapInterval(1);
    6868
  • trunk/src/sdl/sdl_window_manager.cc

    r336 r365  
    1919        if ( SDL_Init(0) < 0 )
    2020        {
    21                 NV_LOG( LOG_CRITICAL, "SDL initialization failed: " << SDL_GetError( ) );
     21                NV_LOG_CRITICAL( "SDL initialization failed: ", SDL_GetError( ) );
    2222                return; // TODO: Error report
    2323        }
Note: See TracChangeset for help on using the changeset viewer.